Skip to content
Snippets Groups Projects
Commit 3b7e8462 authored by Bob Mottram's avatar Bob Mottram
Browse files

Don't ask for freedns code

parent b7e82976
No related branches found
No related tags found
No related merge requests found
...@@ -94,20 +94,11 @@ function interactive_site_details { ...@@ -94,20 +94,11 @@ function interactive_site_details {
while [ ! $SITE_DETAILS_COMPLETE ] while [ ! $SITE_DETAILS_COMPLETE ]
do do
data=$(mktemp 2>/dev/null) data=$(mktemp 2>/dev/null)
if [[ $DDNS_PROVIDER == *"freedns"* ]]; then dialog --backtitle "$SITE_BACKTITLE" \
dialog --backtitle "$SITE_BACKTITLE" \ --title "$SITE_CONFIG_TITLE" \
--title "$SITE_CONFIG_TITLE" \ --form "$SITE_FORM_TEXT" 13 55 3 \
--form "$SITE_FORM_TEXT" 14 55 3 \ $"Domain:" 1 1 "$(grep "${site_name_upper}_DOMAIN_NAME" temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \
$"Domain:" 1 1 "$(grep "${site_name_upper}_DOMAIN_NAME" temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \ 2> "$data"
$"Code:" 2 1 "$(grep "${site_name_upper}_CODE" temp.cfg | awk -F '=' '{print $2}')" 2 16 33 255 \
2> "$data"
else
dialog --backtitle "$SITE_BACKTITLE" \
--title "$SITE_CONFIG_TITLE" \
--form "$SITE_FORM_TEXT" 13 55 3 \
$"Domain:" 1 1 "$(grep "${site_name_upper}_DOMAIN_NAME" temp.cfg | awk -F '=' '{print $2}')" 1 16 33 40 \
2> "$data"
fi
sel=$? sel=$?
case $sel in case $sel in
1) rm -f "$data" 1) rm -f "$data"
...@@ -122,14 +113,6 @@ function interactive_site_details { ...@@ -122,14 +113,6 @@ function interactive_site_details {
if [[ "$TEST_DOMAIN_NAME" != "$SITE_DOMAIN_NAME" ]]; then if [[ "$TEST_DOMAIN_NAME" != "$SITE_DOMAIN_NAME" ]]; then
SITE_DOMAIN_NAME= SITE_DOMAIN_NAME=
dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50 dialog --title $"Domain name validation" --msgbox "$TEST_DOMAIN_NAME" 15 50
else
if [[ "$DDNS_PROVIDER" == *"freedns"* ]]; then
SITE_CODE=$(sed -n 2p < "$data")
validate_freedns_code "$SITE_CODE"
if [ ! "$VALID_CODE" ]; then
SITE_DOMAIN_NAME=
fi
fi
fi fi
fi fi
if [ "$SITE_DOMAIN_NAME" ]; then if [ "$SITE_DOMAIN_NAME" ]; then
...@@ -141,8 +124,10 @@ function interactive_site_details { ...@@ -141,8 +124,10 @@ function interactive_site_details {
# save the results in the config file # save the results in the config file
write_config_param "${site_name_upper}_DOMAIN_NAME" "$SITE_DOMAIN_NAME" write_config_param "${site_name_upper}_DOMAIN_NAME" "$SITE_DOMAIN_NAME"
site_code_str="$SITE_CODE" site_code_str="$SITE_CODE"
if [ ${#site_code_str} -gt 1 ]; then if [ "$site_code_str" ]; then
write_config_param "${site_name_upper}_CODE" "${SITE_CODE}" if [ ${#site_code_str} -gt 1 ]; then
write_config_param "${site_name_upper}_CODE" "${SITE_CODE}"
fi
fi fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment