Indentation
This commit is contained in:
parent
1cfce7c67e
commit
9f0ff21b2a
|
@ -96,11 +96,11 @@ function add_sip_user {
|
|||
IFS=''
|
||||
while read line; do
|
||||
if [[ "$line" == *'</provision>' ]]; then
|
||||
echo "<user id=\"$MY_USERNAME\">" >> $NEW_CONFIG_FILE
|
||||
echo "<extension>$EXTENSION</extension>" >> $NEW_CONFIG_FILE
|
||||
echo "<secret>$PASSWORD</secret>" >> $NEW_CONFIG_FILE
|
||||
echo "<display>$MY_USERNAME $EXTENSION</display>" >> $NEW_CONFIG_FILE
|
||||
echo '</user>' >> $NEW_CONFIG_FILE
|
||||
echo " <user id=\"$MY_USERNAME\">" >> $NEW_CONFIG_FILE
|
||||
echo " <extension>$EXTENSION</extension>" >> $NEW_CONFIG_FILE
|
||||
echo " <secret>$PASSWORD</secret>" >> $NEW_CONFIG_FILE
|
||||
echo " <display>$MY_USERNAME $EXTENSION</display>" >> $NEW_CONFIG_FILE
|
||||
echo ' </user>' >> $NEW_CONFIG_FILE
|
||||
fi
|
||||
echo $line >> $NEW_CONFIG_FILE
|
||||
done < $CONFIG_FILE
|
||||
|
@ -110,29 +110,29 @@ function add_sip_user {
|
|||
|
||||
while [[ $# > 1 ]]
|
||||
do
|
||||
key="$1"
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
show_help
|
||||
;;
|
||||
-u|--user)
|
||||
case $key in
|
||||
-h|--help)
|
||||
show_help
|
||||
;;
|
||||
-u|--user)
|
||||
shift
|
||||
MY_USERNAME="$1"
|
||||
;;
|
||||
-e|--extension)
|
||||
shift
|
||||
EXTENSION="$1"
|
||||
;;
|
||||
-p|--password)
|
||||
shift
|
||||
PASSWORD="$1"
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
MY_USERNAME="$1"
|
||||
;;
|
||||
-e|--extension)
|
||||
shift
|
||||
EXTENSION="$1"
|
||||
;;
|
||||
-p|--password)
|
||||
shift
|
||||
PASSWORD="$1"
|
||||
;;
|
||||
*)
|
||||
# unknown option
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if ! [[ $MY_USERNAME && $EXTENSION && $PASSWORD ]]; then
|
||||
|
|
Loading…
Reference in New Issue