From fb354844bf699bd62d798f7521f3cf2e47fcef21 Mon Sep 17 00:00:00 2001 From: slrslr <6596726+slrslr@users.noreply.github.com> Date: Mon, 6 May 2024 06:03:15 +0200 Subject: [PATCH] add linux uninstall script (#15291) Co-authored-by: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> --- README.md | 18 +++++++++---- install_service_systemd.sh | 2 +- install_service_systemd_mono.sh | 2 +- uninstall_service_systemd.sh | 47 +++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 uninstall_service_systemd.sh diff --git a/README.md b/README.md index cafb6846e..04be2155d 100644 --- a/README.md +++ b/README.md @@ -736,7 +736,7 @@ When installed as a service the tray icon acts as a way to open/start/stop Jacke Jackett can also be run from the command line if you would like to see log messages (Ensure the server isn't already running from the tray/service). This can be done by using "JackettConsole.exe" (for Command Prompt), found in the Jackett data folder: "%ProgramData%\Jackett". -## Install on Linux (AMDx64) +## Installation on Linux (AMDx64) On most operating systems all the required dependencies will already be present. In case they are not, you can refer to this page https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md ### Install as service @@ -756,7 +756,7 @@ Download and extract the latest `Jackett.Binaries.LinuxAMDx64.tar.gz` release fr If you want to run it with a user without a /home directory you need to add `Environment=XDG_CONFIG_HOME=/path/to/folder` to your systemd file, this folder will be used to store your config files. -## Install on Linux (ARMv7 or above) +## Installation on Linux (ARMv7 or above) On most operating systems all the required dependencies will already be present. In case they are not, you can refer to this page https://github.com/dotnet/core/blob/master/Documentation/linux-prereqs.md ### Install as service @@ -793,9 +793,8 @@ On a CentOS/RedHat 7 system: [jewflix.jackett](https://galaxy.ansible.com/jewfli On an Ubuntu 16 system: [chrisjohnson00.jackett](https://galaxy.ansible.com/chrisjohnson00/jackett) -### Installation on Linux or macOS via Homebrew - -[Homebrew Formulae - Jackett](https://formulae.brew.sh/formula/jackett) +## Unistallation on Linux +`wget https://raw.githubusercontent.com/Jackett/Jackett/master/uninstall_service_systemd.sh --quiet -O -|sudo bash` ## Installation on macOS @@ -815,6 +814,15 @@ Logs are stored as usual under `~/.config/Jackett/log.txt`. Download and extract the latest `Jackett.Binaries.macOS.tar.gz` or `Jackett.Binaries.macOSARM64.tar.gz` release from the [releases page](https://github.com/Jackett/Jackett/releases) and run Jackett with the command `./jackett`. +## Unistallation on macOS +`curl -sSL https://raw.githubusercontent.com/Jackett/Jackett/master/uninstall_jackett_macos| bash` + + +## Installation on Linux or macOS via Homebrew + +[Homebrew Formulae - Jackett](https://formulae.brew.sh/formula/jackett) + + ## Installation using Docker Detailed instructions are available at [LinuxServer.io Jackett Docker](https://hub.docker.com/r/linuxserver/jackett/). The Jackett Docker is highly recommended, especially if you are having Mono stability issues or having issues running Mono on your system e.g. QNAP, Synology. Thanks to [LinuxServer.io](https://linuxserver.io) diff --git a/install_service_systemd.sh b/install_service_systemd.sh index 0a6327001..fa43cba80 100755 --- a/install_service_systemd.sh +++ b/install_service_systemd.sh @@ -24,7 +24,7 @@ if systemctl is-active --quiet "${JACKETT_SERVICE}"; then if systemctl stop "${JACKETT_SERVICE}"; then echo "Service '${JACKETT_SERVICE}' stopped" else - echo "${BOLDRED}ERROR${NC}: The service '${JACKETT_SERVICE}' Can not be stopped" + echo "${BOLDRED}ERROR${NC}: The service '${JACKETT_SERVICE}' can not be stopped" exit 1 fi diff --git a/install_service_systemd_mono.sh b/install_service_systemd_mono.sh index c5f5f1405..dd4fe5760 100755 --- a/install_service_systemd_mono.sh +++ b/install_service_systemd_mono.sh @@ -24,7 +24,7 @@ if systemctl is-active --quiet "${JACKETT_SERVICE}"; then if systemctl stop "${JACKETT_SERVICE}"; then echo "Service '${JACKETT_SERVICE}' stopped" else - echo "${BOLDRED}ERROR${NC}: The service '${JACKETT_SERVICE}' Can not be stopped" + echo "${BOLDRED}ERROR${NC}: The service '${JACKETT_SERVICE}' can not be stopped" exit 1 fi diff --git a/uninstall_service_systemd.sh b/uninstall_service_systemd.sh new file mode 100644 index 000000000..2937cabdf --- /dev/null +++ b/uninstall_service_systemd.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +# Define the directory where Jackett was installed +INSTALL_DIR1="/opt/Jackett" +INSTALL_DIR2="/opt/jackett" + +# Define the systemd service file for Jackett +JACKETT_SERVICE_PATH="/etc/systemd/system/jackett.service" + +# Ensure the script is running with superuser privileges +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run as root. Try using 'sudo bash $0'." + exit 1 +fi + +echo "Starting Jackett uninstallation..." + +# Stop the Jackett service +echo "Stopping the Jackett service..." +if systemctl stop jackett.service; then + echo "Jackett service stopped successfully." +else + echo "Failed to stop the Jackett service. It may not have been running." +fi + +# Disable the Jackett service +echo "Disabling the Jackett service..." +if systemctl disable jackett.service; then + echo "Jackett service disabled successfully." +else + echo "Failed to disable the Jackett service." +fi + +# Remove the systemd service file +echo "Removing the systemd service file..." +rm -vf "$JACKETT_SERVICE_PATH" + +# Reload systemd to remove traces of the Jackett service +echo "Reloading systemd daemon..." +systemctl daemon-reload + +# Remove the Jackett installation directory +echo "Removing Jackett installation directory..." +rm -rf "$INSTALL_DIR1" +rm -rf "$INSTALL_DIR2" + +echo "Jackett uninstallation finished."