diff --git a/src/freedombone-addsipuser b/src/freedombone-addsipuser index 219f0456..e6b254d2 100755 --- a/src/freedombone-addsipuser +++ b/src/freedombone-addsipuser @@ -96,11 +96,11 @@ function add_sip_user { IFS='' while read line; do if [[ "$line" == *'' ]]; then - echo "" >> $NEW_CONFIG_FILE - echo "$EXTENSION" >> $NEW_CONFIG_FILE - echo "$PASSWORD" >> $NEW_CONFIG_FILE - echo "$MY_USERNAME $EXTENSION" >> $NEW_CONFIG_FILE - echo '' >> $NEW_CONFIG_FILE + echo " " >> $NEW_CONFIG_FILE + echo " $EXTENSION" >> $NEW_CONFIG_FILE + echo " $PASSWORD" >> $NEW_CONFIG_FILE + echo " $MY_USERNAME $EXTENSION" >> $NEW_CONFIG_FILE + echo ' ' >> $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