summaryrefslogtreecommitdiffstats
path: root/doc/examples
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2016-03-20 18:00:28 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2016-03-20 18:00:28 +0100
commit2e9ef2eda9c49b3b309d4e9e461ef4ebc9cc66a8 (patch)
tree3f8f95ba10d4be8eb1ab1b9a4fa0b5584b319e62 /doc/examples
parent5944dc18a7e8895f5af48e792255b77f9b00cbe5 (diff)
downloadfastd-2e9ef2eda9c49b3b309d4e9e461ef4ebc9cc66a8.tar
fastd-2e9ef2eda9c49b3b309d4e9e461ef4ebc9cc66a8.zip
doc: examples/openwrt/fastd.init: print error message when used without instance arguments
Diffstat (limited to 'doc/examples')
-rw-r--r--doc/examples/openwrt/fastd.init13
1 files changed, 13 insertions, 0 deletions
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'