Skip to content

Commit

Permalink
macos: Update install_service_macos (#8933)
Browse files Browse the repository at this point in the history
  • Loading branch information
thebluepotato committed Jun 10, 2020
1 parent e0310f2 commit f0a4766
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions install_service_macos
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ BOLDGREEN="$(printf '\033[1;32m')"
NC="$(printf '\033[0m')" # No Color

# Stop and unload the service if it's running
launchctl remove org.user.Jackett
launchctl unload ~/Library/LaunchAgents/org.user.Jackett.plist &>/dev/null

# Move working directory to Jackett's
cd "$(dirname "$0")"
Expand Down Expand Up @@ -55,18 +55,20 @@ cat >~/Library/LaunchAgents/org.user.Jackett.plist <<EOL
EOL

# Un-quarantine all dylib and DLL files
echo "Removing Jackett executable and all .dylib and .dll files from quarantine..."
qstr="$(xattr -p com.apple.quarantine jackett)"
qstr="00c1${qstr:4}"
xattr -w com.apple.quarantine $qstr jackett
xattr -w com.apple.quarantine $qstr *.{dylib,dll}
qstr="$(xattr -p com.apple.quarantine jackett)" 2>/dev/null
if [[ $qstr ]]; then
echo "Removing Jackett executable and all .dylib and .dll files from quarantine..."
qstr="00c1${qstr:4}"
xattr -w com.apple.quarantine $qstr jackett
xattr -w com.apple.quarantine $qstr *.{dylib,dll}
fi

# Run the agent
launchctl load ~/Library/LaunchAgents/org.user.Jackett.plist

# Check that it's running
if [[ $(launchctl list | grep org.user.Jackett) ]]; then
echo "${BOLDGREEN}Agent successfully installed and launched!${NC}"
echo "${BOLDGREEN}Agent successfully installed and launched!${NC}"
else
cat << EOL
${BOLDRED}ERROR${NC}: Could not launch agent. The installation might have failed.
Expand Down

0 comments on commit f0a4766

Please sign in to comment.