diff --git a/board/common/overlay/sbin/service b/board/common/overlay/sbin/service new file mode 100755 index 0000000000..7f1e2e07d5 --- /dev/null +++ b/board/common/overlay/sbin/service @@ -0,0 +1,24 @@ +#!/bin/bash + +function show_usage() { + echo "Usage: service [command]" + echo "Usual commands include: start, stop, restart" + echo "Type 'service ' without command for service-specific usage" +} + +if [[ -z "$1" ]]; then + show_usage 1>&2 + exit 1 +fi + +SERVICE=$1 + +shift # Remove $1 +SCRIPT=(/etc/init.d/S*${SERVICE}) + +if ! [[ -x "${SCRIPT}" ]]; then + echo "No such service: ${SERVICE}" + exit 1 +fi + +source ${SCRIPT} "$@"