Upgrade script errors, file had special characters, Parsing was not producing expected results, spawned by: https://github.com/RecursiveProgrammer/Remotely/issues/2

This commit is contained in:
RecursiveProgrammer 2021-03-08 13:34:23 -06:00 committed by Jared Goodwin
parent c541c653ac
commit 4bb2db13b8

View File

@ -1,6 +1,6 @@
#!/bin/bash
AppRoot=$(cat /etc/systemd/system/remotely.service | grep -i "execstart" | cut -d' ' -f 2)
AppRoot=$(cat /etc/systemd/system/remotely.service | grep -i "execstart" | cut -d' ' -f 2 | sed -e 's/\/[^\/]*$/\//')
echo "Remotely server upgrade started."
@ -8,7 +8,6 @@ echo "Target path: $AppRoot"
read -p "If this is not correct, press Ctrl + C now to abort!"
echo "Ensuring dependencies are installed."
# Install other prerequisites.
@ -28,4 +27,4 @@ chown -R "$USER":www-data $AppRoot
# Restart service.
systemctl restart remotely.service
echo "Update complete."
echo "Update complete."