Fix restart script for Debian

This commit is contained in:
Joshua Boniface 2019-02-04 00:26:23 -05:00
parent c4c0894b29
commit f0e74c2c6b
2 changed files with 18 additions and 16 deletions

View File

@ -2,10 +2,12 @@
NAME=jellyfin
restart_cmds=("s6-svc -t /var/run/s6/services/${NAME}" \
"systemctl restart ${NAME}" \
"service ${NAME} restart" \
"/etc/init.d/${NAME} restart")
restart_cmds=(
"systemctl restart ${NAME}"
"service ${NAME} restart"
"/etc/init.d/${NAME} restart"
"s6-svc -t /var/run/s6/services/${NAME}"
)
for restart_cmd in "${restart_cmds[@]}"; do
cmd=$(echo "$restart_cmd" | awk '{print $1}')

View File

@ -10,15 +10,15 @@ Cmnd_Alias STARTSERVER_INITD = /etc/init.d/jellyfin start
Cmnd_Alias STOPSERVER_INITD = /etc/init.d/jellyfin stop
%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV
%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV
%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV
%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD
%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD
%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD
%jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD
%jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD
%jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSV
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSV
jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSV
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_SYSTEMD
jellyfin ALL=(ALL) NOPASSWD: RESTARTSERVER_INITD
jellyfin ALL=(ALL) NOPASSWD: STARTSERVER_INITD
jellyfin ALL=(ALL) NOPASSWD: STOPSERVER_INITD
Defaults!RESTARTSERVER_SYSV !requiretty
Defaults!STARTSERVER_SYSV !requiretty
@ -31,7 +31,7 @@ Defaults!STARTSERVER_INITD !requiretty
Defaults!STOPSERVER_INITD !requiretty
#Allow the server to mount iso images
%jellyfin ALL=(ALL) NOPASSWD: /bin/mount
%jellyfin ALL=(ALL) NOPASSWD: /bin/umount
jellyfin ALL=(ALL) NOPASSWD: /bin/mount
jellyfin ALL=(ALL) NOPASSWD: /bin/umount
Defaults:%jellyfin !requiretty
Defaults:jellyfin !requiretty