diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2018-12-09 22:28:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-12-09 22:28:41 -0500 |
| commit | afb78675b51dbe0795a4ea6e6c38fef0a6133133 (patch) | |
| tree | eec47fa5d639f72861529c23e9115b28198ffb25 /debian/bin/restart.sh | |
| parent | 49c67acf680a26ccde1a210faad5e22e8c395315 (diff) | |
| parent | 0671bb5f44e9da594e1f5689a7ebdf425b19f5e5 (diff) | |
Merge pull request #11 from jellyfin/debian-packaging
Debian packaging 2.0
Diffstat (limited to 'debian/bin/restart.sh')
| -rw-r--r-- | debian/bin/restart.sh | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh new file mode 100644 index 000000000..a6f4632ba --- /dev/null +++ b/debian/bin/restart.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +NAME=jellyfin + +restart_cmds=("s6-svc -t /var/run/s6/services/${NAME}" \ + "systemctl restart ${NAME}" \ + "service ${NAME} restart" \ + "/etc/init.d/${NAME} restart") + +for restart_cmd in "${restart_cmds[@]}"; do + cmd=$(echo "$restart_cmd" | awk '{print $1}') + cmd_loc=$(command -v ${cmd}) + if [[ -n "$cmd_loc" ]]; then + restart_cmd=$(echo "$restart_cmd" | sed -e "s%${cmd}%${cmd_loc}%") + echo "sleep 2; sudo $restart_cmd > /dev/null 2>&1" | at now > /dev/null 2>&1 + exit 0 + fi +done |
