290
1.877.877.2269
BLACKBOX.COM
NEED HELP?
LEAVE THE TECH TO US
LIVE 24/7
TECHNICAL
SUPPORT
1.877.877.2269
CHAPTER 16: ADVANCED CONFIGURATION
# loop indefinitely:
while true
do
# ping the device 10 times
PINGREP=`ping -c 10 -i 1 "$TARGET" `
# get the packet loss percentage
LOSS=`echo "$PINGREP" | grep "%" | \
sed -e 's/.* \([0-9]*\)% .*/\1/'`
if [ "$LOSS" -eq "100" ]
then
COUNTER=`expr $C 1`
else
COUNTER=0
sleep 30s
fi
if [ "$COUNTER" -eq 5 ]
then
COUNTER=0
"$@"
sleep 2s
fi
done
16.1.7 RUNNING CUSTOM SCRIPTS WHEN A CONFIGURATOR IS INVOKED
A configurator is responsible for reading the values in /etc/config/config.xml and making the appropriate changes live. Some
changes made by the configurators are part of the Linux configuration itself, such as user passwords or ipconfig.
Currently there are nineteen configurators, each one responsible for a specific group of config. For example, the users configurator
makes the user configurations in the config.xml file live. To see all the available configurators, type the following from a command
line prompt:
# config
When a change is made using the Management Console web GUI, the appropriate configurator is automatically run. This can be
problematic. If another user or administrator makes a change using the Management Console, the configurator could possibly
overwrite any custom CLI/linux configurations you may have set.
The solution is to create a custom script that runs after each configurator has run. So after each configurator runs, it will check
whether that appropriate custom script exists. You can then add any commands to the custom script and they will be invoked after
the configurator runs.
The custom scripts must be in the correct location:
/etc/config/scripts/config-post-