summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-dns/openresolv/files/restartcmd')
-rw-r--r--net-dns/openresolv/files/restartcmd20
1 files changed, 20 insertions, 0 deletions
diff --git a/net-dns/openresolv/files/restartcmd b/net-dns/openresolv/files/restartcmd
new file mode 100644
index 000000000000..bc2196e54524
--- /dev/null
+++ b/net-dns/openresolv/files/restartcmd
@@ -0,0 +1,20 @@
+#!/bin/sh
+# This script currently supports:
+# - openrc
+# - systemd
+
+if [ -z "${1}" ]; then
+ echo "Missing arguments." >&2
+ exit 1
+fi
+
+if [ -e /run/openrc/softlevel ]; then
+ if /sbin/rc-service -e ${1}; then
+ exec rc-service ${1} -- -Ds restart
+ fi
+elif [ -d /run/systemd/system ]; then
+ exec systemctl try-restart ${1}
+else
+ echo "Unsupported init system." >&2
+ exit 1
+fi