Fix os-svc-restart to exit correctly without -n.
Similar to os-svc-enable, it was trying to run when invoked incorrectly. Change-Id: Ice285d3796149f0c82521da7c5112375cf15c1fe
This commit is contained in:
parent
51e2d265d2
commit
0c38854ef9
|
@ -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 0;;
|
||||
:) usage 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
shift $(($OPTIND-1))
|
||||
if [ -z "$SERVICENAME" ] ; then
|
||||
usage
|
||||
usage 1
|
||||
fi
|
||||
|
||||
function restart_upstart_service {
|
||||
|
|
Loading…
Reference in New Issue