From 2e9ef2eda9c49b3b309d4e9e461ef4ebc9cc66a8 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 20 Mar 2016 18:00:28 +0100 Subject: doc: examples/openwrt/fastd.init: print error message when used without instance arguments --- doc/examples/openwrt/fastd.init | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/examples/openwrt/fastd.init b/doc/examples/openwrt/fastd.init index d910725..6bb48d0 100644 --- a/doc/examples/openwrt/fastd.init +++ b/doc/examples/openwrt/fastd.init @@ -33,6 +33,11 @@ error() { echo "${initscript}:" "$@" 1>&2 } +instance_usage() { + echo "Usage: ${initscript} $1 instance..." 1>&2 + exit 1 +} + get_key_instance() { local s="$1" @@ -397,6 +402,8 @@ reload() { } up() { + [ $# -gt 0 ] || instance_usage 'up' + local exists local instance config_load 'fastd' @@ -409,6 +416,8 @@ up() { } down() { + [ $# -gt 0 ] || instance_usage 'down' + local exists local instance config_load 'fastd' @@ -421,6 +430,8 @@ down() { } show_key() { + [ $# -gt 0 ] || instance_usage 'show_key' + local exists local instance config_load 'fastd' @@ -433,6 +444,8 @@ show_key() { } generate_key() { + [ $# -gt 0 ] || instance_usage 'generate_key' + local exists local instance config_load 'fastd' -- cgit v1.2.3