You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-dns/openresolv/files/restartcmd

21 lines
400 B

#!/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