Configuration file

This commit is contained in:
Bob Mottram 2016-01-25 19:34:42 +00:00
parent 259dbe47b5
commit 226492bcf7
1 changed files with 7 additions and 7 deletions

View File

@ -35,7 +35,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
SELECTED_USERNAME= SELECTED_USERNAME=
SIP_CONFIG_FILE=/etc/sipwitch.conf SIP_CONFIGURATION_FILE=/etc/sipwitch.conf
ADMIN_USER= ADMIN_USER=
UPGRADE_SCRIPT_NAME="${PROJECT_NAME}-upgrade" UPGRADE_SCRIPT_NAME="${PROJECT_NAME}-upgrade"
UPDATE_DATE_SCRIPT=/usr/bin/updatedate UPDATE_DATE_SCRIPT=/usr/bin/updatedate
@ -51,10 +51,10 @@ PROJECT_REPO="https://github.com/bashrc/${PROJECT_NAME}"
USB_DRIVE=sdb USB_DRIVE=sdb
# get default USB from config file # get default USB from config file
CONFIG_FILE=$HOME/${PROJECT_NAME}.cfg CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
if [ -f $CONFIG_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then
if grep -q "USB_DRIVE=" $CONFIG_FILE; then if grep -q "USB_DRIVE=" $CONFIGURATION_FILE; then
USB_DRIVE=$(cat $CONFIG_FILE | grep "USB_DRIVE=" | awk -F '=' '{print $2}') USB_DRIVE=$(cat $CONFIGURATION_FILE | grep "USB_DRIVE=" | awk -F '=' '{print $2}')
if [[ $USB_DRIVE == *"dev"* ]]; then if [[ $USB_DRIVE == *"dev"* ]]; then
USB_DRIVE=$(echo ${USB_DRIVE} | awk -F '/' '{print $3}' | sed 's|1||g' | sed 's|2||g') USB_DRIVE=$(echo ${USB_DRIVE} | awk -F '/' '{print $3}' | sed 's|1||g' | sed 's|2||g')
fi fi
@ -147,7 +147,7 @@ function pad_string {
} }
function show_domains { function show_domains {
DEFAULT_DOMAIN_NAME=$(cat $CONFIG_FILE | grep "DEFAULT_DOMAIN_NAME=" | awk -F '=' '{print $2}') DEFAULT_DOMAIN_NAME=$(cat $CONFIGURATION_FILE | grep "DEFAULT_DOMAIN_NAME=" | awk -F '=' '{print $2}')
echo 'Domains' echo 'Domains'
echo '=======' echo '======='
@ -274,7 +274,7 @@ function show_users {
SIPEXT=$(echo "$ext" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}') SIPEXT=$(echo "$ext" | awk -F '>' '{print $2}' | awk -F '<' '{print $1}')
fi fi
fi fi
done < $SIP_CONFIG_FILE done < $SIP_CONFIGURATION_FILE
if [ $SIPEXT ]; then if [ $SIPEXT ]; then
echo -n -e "$(pad_string SIP:${SIPEXT})" echo -n -e "$(pad_string SIP:${SIPEXT})"
else else