Skip to content

Instantly share code, notes, and snippets.

@1allen
Last active May 8, 2025 05:57
Show Gist options
  • Save 1allen/a0092fb56ae5b85a6e8798826f89dbe6 to your computer and use it in GitHub Desktop.
Save 1allen/a0092fb56ae5b85a6e8798826f89dbe6 to your computer and use it in GitHub Desktop.
ARR app stack management script for PulsedMedia service, generated by AI.

ARR Management Script

Since the original ARR installation script basically performs a one-shot installation and launch only, we still need to start/restart the apps, one by one, or all together.

Description

This script provides functionality to start, restart, and stop individual applications or all applications together. It also includes the ability to keep the apps open after a system restart, making it suitable for use in a crontab to maintain the availability of the applications.

Usage

With No Parameters

When executed with no parameters, the script will launch all the applications by default.

With Parameters

  • app_name: Launches the specified application.
  • restart_app_name: Restarts the specified application.
  • stop_app_name: Stops the specified application.
  • launch_all: Launches all the applications.
  • restart_all: Restarts all the applications.
  • stop_all: Stops all the applications.

Restart Functionality

The script provides the ability to restart individual applications or all applications together using the respective commands mentioned above.

Compatibility with Cron

The script is compatible with cron and can be used to maintain the availability of the applications after a system restart.

# Launch all apps by default
./arr.sh

# Launch individual apps
./arr.sh app_name

# Restart individual apps
./arr.sh restart_app_name

# Stop individual apps
./arr.sh stop_app_name

# Launch all apps
./arr.sh launch_all

# Restart all apps
./arr.sh restart_all

# Stop all apps
./arr.sh stop_all

ARR installation script: https://pulsedmedia.com/remote/pkg/arr_installation.txt

see also: https://www.reddit.com/r/seedboxes/comments/srgmmi/arr_app_installation_script_for_pulsedmedia/

#!/bin/bash
# Function to launch Jellyfin
jellyfin() {
tmux new-session -d -s "jellyfin" "export JELLYFIN_DATA_DIR=$HOME/.config/jellyfin && JELLYFIN_LOG_DIR=$HOME/.config/jellyfin/log && nice -n 19 sh -c $DOTNET_ROOT/dotnet\ $HOME/.bin/jellyfin/jellyfin.dll"
}
# Function to launch Sonarr
sonarr() {
tmux new-session -d -s "sonarr" "mono $HOME/.bin/Sonarr/Sonarr.exe --data=$HOME/.config/sonarr; exec $SHELL"
}
# Function to launch Radarr
radarr() {
tmux new-session -d -s "radarr" "$HOME/.bin/Radarr/Radarr -nobrowser -data=$HOME/.config/radarr; exec $SHELL"
}
# Function to launch Prowlarr
prowlarr() {
tmux new-session -d -s "prowlarr" -n "prowlarr" "$HOME/.bin/Prowlarr/Prowlarr -nobrowser -data=$HOME/.config/prowlarr; exec $SHELL"
}
# Function to launch Sabnzbd
sabnzbd() {
tmux new-session -d -s "sabnzbd" "source $HOME/.bin/sabnzbd/bin/activate && /usr/bin/nice -n 19 python3 $HOME/.bin/sabnzbd/sabnzbd/SABnzbd.py -b 0 -f $HOME/.config/sabnzbd/sabnzbd.ini"
}
# Function to launch Cloudplow
cloudplow() {
tmux new-session -d -s "cloudplow" "source $HOME/.bin/cloudplow/bin/activate && python3 $HOME/.bin/cloudplow/cloudplow/cloudplow.py run --config=$HOME/.config/cloudplow/config.json --loglevel=DEBUG --cachefile=$HOME/.config/cloudplow/cache.db --logfile=$HOME/.config/cloudplow/cloudplow.log"
}
# Function to restart Jellyfin
restart_jellyfin() {
tmux send-keys -t jellyfin C-c
sleep 5
jellyfin
}
# Function to restart Sonarr
restart_sonarr() {
tmux send-keys -t sonarr C-c
sleep 5
sonarr
}
# Function to restart Radarr
restart_radarr() {
tmux send-keys -t radarr C-c
sleep 5
radarr
}
# Function to restart Prowlarr
restart_prowlarr() {
tmux send-keys -t prowlarr C-c
sleep 5
prowlarr
}
# Function to restart Sabnzbd
restart_sabnzbd() {
tmux send-keys -t sabnzbd C-c
sleep 5
sabnzbd
}
# Function to restart Cloudplow
restart_cloudplow() {
tmux send-keys -t cloudplow C-c
sleep 5
cloudplow
}
# Function to launch all apps
launch_all() {
jellyfin
sonarr
radarr
prowlarr
sabnzbd
cloudplow
}
# Function to restart all apps
restart_all() {
tmux send-keys -t jellyfin C-c
tmux send-keys -t sonarr C-c
tmux send-keys -t radarr C-c
tmux send-keys -t prowlarr C-c
tmux send-keys -t sabnzbd C-c
tmux send-keys -t cloudplow C-c
sleep 5
launch_all
}
# Launch all apps by default
case "$1" in
"")
launch_all
;;
"jellyfin")
jellyfin
;;
"sonarr")
sonarr
;;
"radarr")
radarr
;;
"prowlarr")
prowlarr
;;
"sabnzbd")
sabnzbd
;;
"cloudplow")
cloudplow
;;
"restart_jellyfin")
restart_jellyfin
;;
"restart_sonarr")
restart_sonarr
;;
"restart_radarr")
restart_radarr
;;
"restart_prowlarr")
restart_prowlarr
;;
"restart_sabnzbd")
restart_sabnzbd
;;
"restart_cloudplow")
restart_cloudplow
;;
"launch_all")
launch_all
;;
"restart_all")
restart_all
;;
*)
echo "Invalid command. Please choose from jellyfin, sonarr, radarr, prowlarr, sabnzbd, cloudplow, restart_jellyfin, restart_sonarr, restart_radarr, restart_prowlarr, restart_sabnzbd, restart_cloudplow, launch_all, or restart_all."
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment