freedns updater improvements
This commit is contained in:
parent
c3895f3fb5
commit
c6262e7e3e
|
@ -35,7 +35,7 @@ export TEXTDOMAINDIR="/usr/share/locale"
|
||||||
|
|
||||||
VERBOSE=
|
VERBOSE=
|
||||||
CONFIGURATION_FILE=$HOME/${PROJECT_NAME}.cfg
|
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?'
|
FREEDNS_WGET='wget --read-timeout=0.0 --waitretry=5 --tries=4 https://freedns.afraid.org/dynamic/update.php?'
|
||||||
|
|
||||||
if [[ "$1" == "--verbose" || "$1" == "-v" ]]; then
|
if [[ "$1" == "--verbose" || "$1" == "-v" ]]; then
|
||||||
VERBOSE=1
|
VERBOSE=1
|
||||||
|
@ -55,9 +55,6 @@ detected_codes=()
|
||||||
codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
|
codelines=$(grep "_CODE=" $CONFIGURATION_FILE | uniq)
|
||||||
while read -r line; do
|
while read -r line; do
|
||||||
code=$(echo "$line" | awk -F '=' '{print $2}')
|
code=$(echo "$line" | awk -F '=' '{print $2}')
|
||||||
if [ $VERBOSE ]; then
|
|
||||||
echo $"freedns code $code"
|
|
||||||
fi
|
|
||||||
item_in_array "$code" "${detected_codes[@]}"
|
item_in_array "$code" "${detected_codes[@]}"
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
detected_codes+=("$code")
|
detected_codes+=("$code")
|
||||||
|
@ -70,7 +67,12 @@ fi
|
||||||
cd $HOME/.freedns-update
|
cd $HOME/.freedns-update
|
||||||
for code in "${detected_codes[@]}"
|
for code in "${detected_codes[@]}"
|
||||||
do
|
do
|
||||||
$FREEDNS_WGET${code}
|
if [ $VERBOSE ]; then
|
||||||
|
echo $"command: $FREEDNS_WGET${code}="
|
||||||
|
$FREEDNS_WGET${code}=
|
||||||
|
else
|
||||||
|
$FREEDNS_WGET${code}= >> /tmp/freedns 2>&1
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Reference in New Issue