aboutsummaryrefslogtreecommitdiff
path: root/debian/restart.sh
diff options
context:
space:
mode:
authorJoshua Boniface <joshua@boniface.me>2018-08-08 01:18:59 -0400
committerVasily <just.one.man@yandex.ru>2018-10-22 01:56:13 +0300
commitc0953e51b5019c968fe5d9c8f25f47f08ed4e829 (patch)
treebd8a44c47c18050550e17a2ffd1dd9bed56e5d88 /debian/restart.sh
parent48facb797ed912e4ea6b04b17d1ff190ac2daac4 (diff)
Add patches and debian build information for emby-server
Diffstat (limited to 'debian/restart.sh')
-rw-r--r--debian/restart.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/debian/restart.sh b/debian/restart.sh
new file mode 100644
index 000000000..4d83624a0
--- /dev/null
+++ b/debian/restart.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+NAME=emby-server
+
+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