diff options
author | Jakob Stendahl <jakob.stendahl@outlook.com> | 2018-11-30 10:58:10 +0100 |
---|---|---|
committer | Jakob Stendahl <jakob.stendahl@outlook.com> | 2018-11-30 10:58:10 +0100 |
commit | ae98cf39c956033c98dcf6d11be4df95f58fff47 (patch) | |
tree | 59a0a8adcc2d224aef29e981387aa89c325a2b14 /bin/luxcena-neo-cli.sh | |
parent | 949dd6a5b0d6fce587a51904acabe3e2191924f9 (diff) | |
download | Luxcena-Neo-ae98cf39c956033c98dcf6d11be4df95f58fff47.tar.gz Luxcena-Neo-ae98cf39c956033c98dcf6d11be4df95f58fff47.zip |
:construction: CLI is now self-updating!
Realized that shell scripts are loaded into memory before being run. this means we can both make it update itself, and delete itself.
Diffstat (limited to 'bin/luxcena-neo-cli.sh')
-rwxr-xr-x | bin/luxcena-neo-cli.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/bin/luxcena-neo-cli.sh b/bin/luxcena-neo-cli.sh index 763bbbe..5521749 100755 --- a/bin/luxcena-neo-cli.sh +++ b/bin/luxcena-neo-cli.sh @@ -66,9 +66,11 @@ if [ "$action" == "update" ]; then systemctl stop lxucena-neo runuser -l 'lux-neo' -c 'git -C ~/src pull' runuser -l 'lux-neo' -c 'export NODE_ENV=production; npm --prefix ~/src install ~/src --only=production' - printf "Update complete, run these commands to finish it completly:\n" - printf "sudo /home/lux-neo/src/bin/post-update.sh\n" - printf "sudo systemctl luxcena-neo start\n" + cp /home/lux-neo/src/bin/luxcena-neo-cli.sh /usr/bin/luxcena-neo-cli.sh + printf "Update complete.\n" + #printf "Update complete, run these commands to finish it completly:\n" + #printf "sudo /home/lux-neo/src/bin/post-update.sh\n" + #printf "sudo systemctl luxcena-neo start\n" systemctl start luxcena-neo elif [ "$action" == "uninstall" ]; then @@ -85,12 +87,12 @@ elif [ "$action" == "uninstall" ]; then deluser lux-neo rm -rf /home/lux-neo rm /etc/systemd/system/luxcena-neo.service + rm /usr/bin/luxcena-neo.sh + rm /usr/bin/lux-neo + tput setaf 2 - printf "\nEverything should now be gone. To remove the last piece, enter this command:\n" - tput sgr0 - tput smso - printf "sudo rm /bin/luxcena-neo\n\n" + printf "\nEverything should now be gone.\n" tput sgr0 tput setaf 8 printf "Well, some dependencies still exists. Those are:\n" |