0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt# This script is called by "systemctl enable/disable" when the given unit is a
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt# SysV init.d script. It needs to call the distribution's mechanism for
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt# enabling/disabling those, such as chkconfig, update-rc.d, or similar. This
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt# can optionally take a --root argument for enabling a SysV init script
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt# in a chroot or similar.
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt echo "Usage: $0 [--root=path] enable|disable|is-enabled <sysv script name>" >&2
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt# parse options
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitteval set -- "$(getopt -o r: --long root: -- "$@")"
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pittwhile true; do
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt --) shift ; break ;;
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt # call the command to enable SysV init script $NAME here
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt # (consider optional $ROOT)
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt echo "IMPLEMENT ME: enabling SysV init.d script $NAME"
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt # call the command to disable SysV init script $NAME here
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt # (consider optional $ROOT)
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt echo "IMPLEMENT ME: disabling SysV init.d script $NAME"
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt # exit with 0 if $NAME is enabled, non-zero if it is disabled
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt # (consider optional $ROOT)
0f0467e63b0e0688ae9edb1512c1a2637d62ddb4Martin Pitt echo "IMPLEMENT ME: checking SysV init.d script $NAME"