systemd-sysv-install.SKELETON revision 0f0467e63b0e0688ae9edb1512c1a2637d62ddb4
0N/A#!/bin/sh
0N/A# This script is called by "systemctl enable/disable" when the given unit is a
0N/A# SysV init.d script. It needs to call the distribution's mechanism for
0N/A# enabling/disabling those, such as chkconfig, update-rc.d, or similar. This
0N/A# can optionally take a --root argument for enabling a SysV init script
0N/A# in a chroot or similar.
0N/Aset -e
0N/A
0N/Ausage() {
0N/A echo "Usage: $0 [--root=path] enable|disable|is-enabled <sysv script name>" >&2
0N/A exit 1
0N/A}
0N/A
0N/A# parse options
0N/Aeval set -- "$(getopt -o r: --long root: -- "$@")"
0N/Awhile true; do
0N/A case "$1" in
0N/A -r|--root)
873N/A ROOT="$2"
0N/A shift 2 ;;
0N/A --) shift ; break ;;
0N/A *) usage ;;
0N/A esac
0N/Adone
3231N/A
0N/ANAME="$2"
0N/A[ -n "$NAME" ] || usage
0N/A
0N/Acase "$1" in
0N/A enable)
0N/A # call the command to enable SysV init script $NAME here
0N/A # (consider optional $ROOT)
0N/A echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
0N/A ;;
0N/A disable)
0N/A # call the command to disable SysV init script $NAME here
0N/A # (consider optional $ROOT)
0N/A echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
0N/A ;;
0N/A is-enabled)
0N/A # exit with 0 if $NAME is enabled, non-zero if it is disabled
0N/A # (consider optional $ROOT)
0N/A echo "IMPLEMENT ME: checking SysV init.d script $NAME"
0N/A ;;
0N/A *)
0N/A usage ;;
0N/Aesac
0N/A