diff options
author | B. Stack <bgstack15@gmail.com> | 2024-05-13 14:46:34 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-05-13 14:46:34 -0400 |
commit | 513932b3c8dc2d22bb17fd0680c7461c013de433 (patch) | |
tree | 4950284e4bc1c4417d8843db96b730a266463416 /rpm/restart.sh | |
parent | Disable non-Windows portable FFmpeg integration (diff) | |
download | jellyfin-packaging-513932b3c8dc2d22bb17fd0680c7461c013de433.tar.gz jellyfin-packaging-513932b3c8dc2d22bb17fd0680c7461c013de433.tar.bz2 jellyfin-packaging-513932b3c8dc2d22bb17fd0680c7461c013de433.zip |
add initial research for rpm
Diffstat (limited to 'rpm/restart.sh')
-rwxr-xr-x | rpm/restart.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/rpm/restart.sh b/rpm/restart.sh new file mode 100755 index 0000000..9b64b6d --- /dev/null +++ b/rpm/restart.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# restart.sh - Jellyfin server restart script +# Part of the Jellyfin project (https://github.com/jellyfin) +# +# This script restarts the Jellyfin daemon on Linux when using +# the Restart button on the admin dashboard. It supports the +# systemctl, service, and traditional /etc/init.d (sysv) restart +# methods, chosen automatically by which one is found first (in +# that order). +# +# This script is used by the Debian/Ubuntu/Fedora/CentOS packages. + +get_service_command() { + for command in systemctl service; do + if which $command &>/dev/null; then + echo $command && return + fi + done + echo "sysv" +} + +cmd="$( get_service_command )" +echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." +case $cmd in + 'systemctl') + echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now + ;; + 'service') + echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now + ;; + 'sysv') + echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now + ;; +esac +exit 0 |