Laird WB45NBT Reference Manual page 27

Hide thumbs Also See for WB45NBT:
Table of Contents

Advertisement

WB45NBT
Reference Guide
bridge.sh – Bridging interface setup.
Example init-script:
#!/bin/sh
# name - and a brief description
# details, author, usage...
case $1 in
stop)
echo "Starting some task"
##
## steps to perform during shutdown only
##
;;
start)
echo "Stopping some task"
##
## steps to perform during bootup only
##
;;
esac
In the above example, the first line is asking for the system shell to interpret the script. Since busybox ash is
assumed, you may want to be more explicit (use /bin/ash or /bin/hush).
Next are parse and handle commands as the first argument.
The first argument is tested for match. When rcS is calling the script, it uses either start or stop. Additional
commands can also be handled if the script needs to provide additional tasks such as restart or status.
restart)
echo "Restarting some task"
$0 stop
$0 start
;;
In this example, the script calls itself for stop and then start, providing a restart action.
Note: The init-scripts must always return within a reasonably short period; they are expected to do some
series of steps and then be finished so that the rcS can move on to the next script. Otherwise the
system appears to hang.
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
27
© Copyright 2017 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0610

Advertisement

Table of Contents
loading

Table of Contents