mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Enhance the service installation on MacOS (#1793)
* Make the script self-executing * Update script with colors Since it’s self-executing, at least the output is more visible * Changes to README * Update Jackett.Console.csproj * Clarify README
This commit is contained in:
@@ -291,7 +291,8 @@ Install [Mono 4](http://www.mono-project.com/download/#download-mac) or better (
|
|||||||
|
|
||||||
### Install as service
|
### Install as service
|
||||||
1. Download and extract the latest `Jackett.Binaries.Mono.tar.gz` release from the [releases page](https://github.com/Jackett/Jackett/releases).
|
1. Download and extract the latest `Jackett.Binaries.Mono.tar.gz` release from the [releases page](https://github.com/Jackett/Jackett/releases).
|
||||||
2. In Terminal, run the install script from the extracted directory using `./install_service_macos.sh`
|
2. Open the extracted folder and double-click on `install_service_macos`.
|
||||||
|
3. If the installation was a success, you can close the Terminal window.
|
||||||
|
|
||||||
The service will start on each logon. You can always stop it by running `launchctl unload ~/Library/LaunchAgents/org.user.Jackett.plist` from Terminal. You can start it again it using `launchctl load ~/Library/LaunchAgents/org.user.Jackett.plist`.
|
The service will start on each logon. You can always stop it by running `launchctl unload ~/Library/LaunchAgents/org.user.Jackett.plist` from Terminal. You can start it again it using `launchctl load ~/Library/LaunchAgents/org.user.Jackett.plist`.
|
||||||
Logs are stored as usual under `~/.config/Jackett/log.txt`.
|
Logs are stored as usual under `~/.config/Jackett/log.txt`.
|
||||||
|
@@ -153,7 +153,7 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config" />
|
<None Include="App.config" />
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
<Content Include="install_service_macos.sh">
|
<Content Include="install_service_macos">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@@ -1,5 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
#Setting up colors
|
||||||
|
BOLDRED="$(printf '\033[1;31m')"
|
||||||
|
BOLDGREEN="$(printf '\033[1;32m')"
|
||||||
|
NC="$(printf '\033[0m')" # No Color
|
||||||
|
|
||||||
# Stop and unload the service if it's running
|
# Stop and unload the service if it's running
|
||||||
launchctl remove org.user.Jackett
|
launchctl remove org.user.Jackett
|
||||||
|
|
||||||
@@ -8,18 +13,18 @@ cd "$(dirname "$0")"
|
|||||||
|
|
||||||
# Check if we're running from Jackett's directory
|
# Check if we're running from Jackett's directory
|
||||||
if [ ! -f ./JackettConsole.exe ]; then
|
if [ ! -f ./JackettConsole.exe ]; then
|
||||||
echo "Couldn't locate JackettConsole.exe. Is the script in the right directory?"
|
echo "${BOLDRED}ERROR${NC}: Couldn't locate JackettConsole.exe. Is the script in the right directory?"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
jackettdir="$(pwd)"
|
jackettdir="$(pwd)"
|
||||||
|
|
||||||
# Check if mono is installed
|
# Check if mono is installed
|
||||||
command -v mono >/dev/null 2>&1 || { echo >&2 "Jackett requires Mono but it's not installed. Aborting."; exit 1; }
|
command -v mono >/dev/null 2>&1 || { echo >&2 "${BOLDRED}ERROR${NC}: Jackett requires Mono but it's not installed. Aborting."; exit 1; }
|
||||||
monodir="$(dirname $(command -v mono))"
|
monodir="$(dirname $(command -v mono))"
|
||||||
|
|
||||||
# Check that no other service called Jackett is already running
|
# Check that no other service called Jackett is already running
|
||||||
if [[ $(launchctl list | grep org.user.Jackett) ]]; then
|
if [[ $(launchctl list | grep org.user.Jackett) ]]; then
|
||||||
echo "Jackett already seems to be running as a service. Please stop it before running this script again."
|
echo "${BOLDRED}ERROR${NC}: Jackett already seems to be running as a service. Please stop it before running this script again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -59,12 +64,13 @@ launchctl load ~/Library/LaunchAgents/org.user.Jackett.plist
|
|||||||
|
|
||||||
# Check that it's running
|
# Check that it's running
|
||||||
if [[ $(launchctl list | grep org.user.Jackett) ]]; then
|
if [[ $(launchctl list | grep org.user.Jackett) ]]; then
|
||||||
echo "Agent successfully installed and launched!"
|
echo "${BOLDGREEN}Agent successfully installed and launched!${NC}"
|
||||||
else
|
else
|
||||||
cat << EOL
|
cat << EOL
|
||||||
Could not launch agent. The installation might have failed.
|
${BOLDRED}ERROR${NC}: Could not launch agent. The installation might have failed.
|
||||||
Please open an issue on https://github.com/Jackett/Jackett/issues and paste following information:
|
Please open an issue on https://github.com/Jackett/Jackett/issues and paste following information:
|
||||||
Mono directory: \`${monodir}\`
|
Mono directory: \`${monodir}\`
|
||||||
Jackett directory: \`${jackettdir}\`
|
Jackett directory: \`${jackettdir}\`
|
||||||
|
|
||||||
EOL
|
EOL
|
||||||
fi
|
fi
|
Reference in New Issue
Block a user