The Free Software Media System - Server Backend & API
Don't restart with sudo(8) if it's not available
AJ Jordan2911dfc37d79
diff --git a/debian/bin/restart.sh b/debian/bin/restart.shindex 46a70c497e..6aea24ee49 100755--- a/debian/bin/restart.sh+++ b/debian/bin/restart.sh@@ -34,13 +34,19 @@ elsefifi+if type sudo >/dev/null 2>&1; then+ sudo_command=sudo+else+ sudo_command=+fi+echo "Detected service control platform '$cmd'; using it to restart Jellyfin..."case $cmd in'systemctl')- echo "sleep 0.5; /usr/bin/sudo systemctl start jellyfin" | at now+ echo "sleep 0.5; $sudo_command systemctl start jellyfin" | at now;;'service')- echo "sleep 0.5; /usr/bin/sudo service jellyfin start" | at now+ echo "sleep 0.5; $sudo_command service jellyfin start" | at now;;'sysv')echo "sleep 0.5; /usr/bin/sudo /etc/init.d/jellyfin start" | at nowdiff --git a/fedora/restart.sh b/fedora/restart.shindex 46a70c497e..6aea24ee49 100755--- a/fedora/restart.sh+++ b/fedora/restart.sh@@ -34,13 +34,19 @@ elsefifi+if type sudo >/dev/null 2>&1; then+ sudo_command=sudo+else+ sudo_command=+fi+echo "Detected service control platform '$cmd'; using it to restart Jellyfin..."case $cmd in'systemctl')- echo "sleep 0.5; /usr/bin/sudo systemctl start jellyfin" | at now+ echo "sleep 0.5; $sudo_command systemctl start jellyfin" | at now;;'service')- echo "sleep 0.5; /usr/bin/sudo service jellyfin start" | at now+ echo "sleep 0.5; $sudo_command service jellyfin start" | at now;;'sysv')echo "sleep 0.5; /usr/bin/sudo /etc/init.d/jellyfin start" | at now