os-svc-enable should error when no svcname given.

The usage call when checking for SERVICENAME did not exit. Ooops.

Change-Id: Ie0cbc0f8abf8801f71f2b846af11e73dfed9af8e
This commit is contained in:
Robert Collins 2014-02-05 12:49:49 +13:00
parent 5fdbf8965f
commit 51e2d265d2
1 changed files with 5 additions and 4 deletions

View File

@ -23,6 +23,7 @@ usage() {
echo " -h Show help and exit"
echo " -n SERVICENAME Name of job/service file."
echo ""
exit $1
}
SERVICENAME=${SERVICENAME:-""}
@ -31,15 +32,15 @@ nshift=0
while getopts "hn:" opt; do
case "$opt" in
n) SERVICENAME=$OPTARG;;
h) usage; exit 0;;
\?) usage; exit 1;;
:) usage; exit 1;;
h) usage 0;;
\?) usage 1;;
:) usage 1;;
esac
done
shift $(($OPTIND-1))
if [ -z "$SERVICENAME" ] ; then
usage
usage 1
fi
function enable_upstart_service {