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

Verbose option for freedns

parent bf025a03
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@
# License
# =======
#
# Copyright (C) 2016 Bob Mottram <bob@freedombone.net>
# Copyright (C) 2016-2017 Bob Mottram <bob@freedombone.net>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
......@@ -33,9 +33,14 @@ PROJECT_NAME='freedombone'
export TEXTDOMAIN=${PROJECT_NAME}-freedns
export TEXTDOMAINDIR="/usr/share/locale"
VERBOSE=
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
FREEDNS_WGET='wget -q --read-timeout=0.0 --waitretry=5 --tries=4 https://freedns.afraid.org/dynamic/update.php?'
if [[ "$1" == "--verbose" || "$1" == "-v" ]]; then
VERBOSE=1
fi
if [ ! -f $CONFIGURATION_FILE ]; then
exit 0
fi
......@@ -47,10 +52,13 @@ function item_in_array {
}
detected_codes=()
codelines=($(grep "_CODE=" $CONFIGURATION_FILE | uniq))
codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
for line in "${codelines[@]}"
do
code=$(echo "$line" | awk -F '=' '{print $2}')
if [ $VERBOSE ]; then
echo $"freedns code $code"
fi
item_in_array "$code" "${detected_codes[@]}"
if [[ $? != 0 ]]; then
detected_codes+=("$code")
......
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