add-imscore-user_newdb.sh File Reference

Go to the source code of this file.

Functions

 Usage ()

Variables

 OPTION_ADD
do case $option inIMSUSER = $OPTARG
REALM = $OPTARG
IMPI = $OPTARG
IMPU = $OPTARG
TELURI = $OPTARG
PASSWORD = $OPTARG
OPTION_ADD = 1
OPTION_DELETE = 1
OPTION_CLEANUP = 1
esac done &&[-z"$REALM"] REALM
then IMSUSER
 CREATE_SCRIPT
then echo Failed to write
$CREATE_SCRIPT exit fi 
if [!-z $TELURI]
then echo Failed to write
$DELETE_SCRIPT exit fi 
if [!-z $TELURI]
then echo Apply $CREATE_SCRIPT
as user $DBUSER mysql u $DBUSER
p< $CREATE_SCRIPT > dev null 
EXIT_CODE


Function Documentation

Usage (  ) 

Definition at line 49 of file add-imscore-user_newdb.sh.

00050 {
00051     echo "ERROR: Invalid parameters"
00052     echo "add-imscore-user.sh -u <user> [-t <tel-URI>] [-r <realm> -p <password>] [-a|-d]"
00053     echo "  -u <user>: The username (e.g. 'brooke')"
00054     echo "  -t <tel-URI>: The tel-URI (e.g. 'tel:+49123456789'). If used with -a, -d requires"
00055     echo "     this parameter too!"
00056     echo "  -r <realm>: The realm. Default is 'open-ims.test'"
00057     echo "  -i <impi>: The Private Identity (e.g. 'brooke@open-ims.test'). The -u option overrides this."
00058     echo "  -b <impu>: The Public Identity (e.g. 'sip:brooke@open-ims.test') The -u option overrides this."
00059     echo "  -p <password>: The password. Default is value of -u option"
00060     echo "  -a: Automatically apply created add script"
00061     echo "  -d: Automatically apply created delete script"
00062     echo "  -c: Delete the scripts afterwards (by default they are not deleted)"
00063     exit -1
00064 }


Variable Documentation

OPTION_ADD

Initial value:

0
OPTION_DELETE=0
OPTION_CLEANUP=0
SCRIPT=
EXIT_CODE=0
DBUSER=root

while getopts u:r:i:b:p:o:c?:adt:? option

Definition at line 66 of file add-imscore-user_newdb.sh.

do case $option in u IMSUSER = $OPTARG

Definition at line 76 of file add-imscore-user_newdb.sh.

r REALM = $OPTARG

Definition at line 77 of file add-imscore-user_newdb.sh.

i IMPI = $OPTARG

Definition at line 78 of file add-imscore-user_newdb.sh.

b IMPU = $OPTARG

Definition at line 79 of file add-imscore-user_newdb.sh.

t TELURI = $OPTARG

Definition at line 80 of file add-imscore-user_newdb.sh.

p PASSWORD = $OPTARG

Definition at line 81 of file add-imscore-user_newdb.sh.

a OPTION_ADD = 1

Definition at line 82 of file add-imscore-user_newdb.sh.

d OPTION_DELETE = 1

Definition at line 83 of file add-imscore-user_newdb.sh.

c OPTION_CLEANUP = 1

Definition at line 84 of file add-imscore-user_newdb.sh.

esac done&& [ -z "$REALM" ] REALM

Initial value:

open-ims.test
if [ -z "$IMSUSER" ]

Definition at line 88 of file add-imscore-user_newdb.sh.

then IMSUSER

Initial value:

${IMPI%%@*}
else
    IMPI="$IMSUSER@$REALM"
    IMPU="sip:$IMSUSER@$REALM"
fi
[ -z "$PASSWORD" ] && PASSWORD=$IMSUSER
[ -z "$IMSUSER" ] && Usage


[ $OPTION_ADD -eq 1 ] && [ $OPTION_DELETE -eq 1 ] && Usage

Definition at line 91 of file add-imscore-user_newdb.sh.

CREATE_SCRIPT

Definition at line 105 of file add-imscore-user_newdb.sh.

then echo Failed to write $DELETE_SCRIPT exit fi fi echo $DELETE_IMPI_TEMPLATE sed $SED_SCRIPT $DELETE_SCRIPT echo Successfully wrote $DELETE_SCRIPT if[$OPTION_ADD-eq 1]

Definition at line 183 of file add-imscore-user_newdb.sh.

then echo Failed to write $DELETE_SCRIPT exit fi if[!-z $TELURI]

Definition at line 198 of file add-imscore-user_newdb.sh.

then echo Apply $CREATE_SCRIPT as user $DBUSER mysql u $DBUSER p< $CREATE_SCRIPT > dev null EXIT_CODE

Initial value:

$?
    SCRIPT=$CREATE_SCRIPT
elif [ $OPTION_DELETE -eq 1 ]

Definition at line 212 of file add-imscore-user_newdb.sh.


Generated on Sat Sep 6 04:17:49 2008 for Open IMS Core CSCFs by  doxygen 1.5.2