#!/bin/sh # TODO: Enable/disable actions type restart >/dev/null || restart() { stop start } type reload >/dev/null || reload() { stop start } usage() { printf 'Usage: %s {start|stop|restart|reload}\n' "${0}" } main() { local action="${1}" case "${action}" in 'start'|'stop'|'restart'|'reload');; *) usage >&2 return 1 ;; esac "${action}" return ${?} } main "${@}"