scripts: update uninstallation script

Remove the LSB or systemd service, depending on which is installed.

SIgned-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-02-08 06:45:01 -05:00
parent 0fcae5b6e4
commit f9dcda7ba9
1 changed files with 17 additions and 9 deletions

View File

@ -4,20 +4,25 @@
stop_service() { stop_service() {
# Stop Moonraker Service # Stop Moonraker Service
echo "#### Stopping Moonraker Service.." echo "#### Stopping Moonraker Service.."
sudo service moonraker stop sudo systemctl stop moonraker
} }
remove_service() { remove_service() {
# Remove Moonraker from Startup # Remove Moonraker LSB/systemd service
echo
echo "#### Removing Moonraker from Startup.."
sudo update-rc.d -f moonraker remove
# Remove Moonraker from Services
echo echo
echo "#### Removing Moonraker Service.." echo "#### Removing Moonraker Service.."
sudo rm -f /etc/init.d/moonraker /etc/default/moonraker if [ -f "/etc/init.d/moonraker" ]; then
# legacy installation, remove the LSB service
sudo update-rc.d -f moonraker remove
sudo rm -f /etc/init.d/moonraker
sudo rm -f /etc/default/moonraker
else
# Remove systemd installation
sudo systemctl disable moonraker
sudo rm -f /etc/systemd/system/moonraker.service
sudo systemctl daemon-reload
sudo systemctl reset-failed
fi
} }
remove_sudo_fix() { remove_sudo_fix() {
@ -55,6 +60,9 @@ remove_files() {
echo echo
echo "The following command is typically used to remove source files:" echo "The following command is typically used to remove source files:"
echo " rm -rf ~/moonraker" echo " rm -rf ~/moonraker"
echo
echo "You may also wish to uninstall nginx:"
echo " sudo apt-get remove nginx"
} }
verify_ready() verify_ready()