diff options
Diffstat (limited to 'multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-dhcpd')
-rwxr-xr-x | multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-dhcpd | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-dhcpd b/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-dhcpd index 575b803..cafc1be 100755 --- a/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-dhcpd +++ b/multitech/recipes/ocg-scripts/ocg-scripts-1.0/ocg-dhcpd @@ -10,11 +10,14 @@ do_stop() { killall udhcpd } -# main -if [[ $# -ne 1 ]] -then - echo "usage: $0 start|stop|restart" +usage() { + echo "Usage: $(basename $0) start|stop|restart" exit 1 +} + +# main +if [[ $# != 1 ]]; then + usage fi case $1 in @@ -31,8 +34,12 @@ case $1 in ;; restart) do_stop + sleep 1 do_start ;; + *) + usage + ;; esac exit 0 |