24 lines
555 B
Bash
24 lines
555 B
Bash
|
EXEC_SHELL_PATH=$(command -v bash)
|
||
|
|
||
|
MULLVAD="/nix/var/nix/profiles/default/bin/mullvad-daemon"
|
||
|
LOG_FILE="/tmp/mullvad.log"
|
||
|
|
||
|
|
||
|
# Create the log directory if it doesn't exist
|
||
|
mkdir -p "$(dirname "$LOG_FILE")"
|
||
|
|
||
|
|
||
|
# Check if Navidrome is already running
|
||
|
if pgrep -x "mullvad" > /dev/null; then
|
||
|
echo "mullvad is already running. Exiting."
|
||
|
else
|
||
|
# Run Navidrome command, redirecting output to the log file and detaching it from the terminal
|
||
|
setsid nohup $MULLVAD > "$LOG_FILE" 2>&1 &
|
||
|
echo "mullvad started and detached from the terminal."
|
||
|
fi
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|