
1101 and 1102 Secure Device Servers
email to more than one email address, find the lines in the script responsible for invoking the
export
These two lines assign a new email address to TOADDR and invoke the
The
For example, if we have five users configured and we use the script to delete user 3, then user 4 will become user 3, and user 5 will become user 4.
This creates an obvious complication because this script does NOT check for any other dependencies that the node being deleted may have. You are responsible for making sure that any references and dependencies connected to the deleted node are removed or corrected in the config.xml file.
The script treats all nodes the same. The syntax to run the script is
# ./delete-node config.users.user3
The delete-node script
#!/bin/bash
#User must provide the node to be removed. For example, "config.users.user1"
# Usage:
if [ $# != 1 ] then
echo "Wrong number of arguments"
echo "Usage: delnode {full '.' delimited node path}" exit 2
fi
# test for spaces
TEMP=`echo "$1" sed 's/.* .*/N/'` if [ "$TEMP" = "N" ]
then
echo "Wrong input format"
echo "Usage: delnode {full '.' delimited node path}" exit 2
fi
#testing if node exists TEMP=`config
then
echo "Node $1 not found" exit 0
fi
#LASTFIELD is the last field in the node path e.g. "user1"
#ROOTNODE is the upper level of the node e.g. "config.users"
#NUMBER is the integer value extracted from LASTFIELD e.g. "1"
#TOTALNODE is the node name for the total e.g. "config.users.total"
#TOTAL is the value of the total number of items before deleting e.g. "3"
#NEWTOTAL is the modified total i.e.
#CHECKTOTAL checks if TOTAL is the actual total items in .xml
LASTFIELD=${1##*.}
ROOTNODE=${1%.*}
NUMBER=`echo $LASTFIELD sed
TOTALNODE=`echo ${1%.*} sed 's/\(.*\)/\1.total/'`
TOTAL=`config
138 |