Skip to content

Commit

Permalink
Automate speedtest server daily
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Mar 28, 2019
1 parent 55a3cc5 commit 257578d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions quickfix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,25 @@ allowupdate=`/usr/local/bin/nems-info allowupdate`
echo " done."
fi

printf "Setting Internet speedtest server..."
# Detect current first since this will create the conf if missing
speedtestcurrent=`/usr/local/bin/nems-info speedtest`
# Detect the best server
speedtestbest=`/usr/local/bin/nems-info speedtest best`
# Overwrite the conf
if (( $speedtestcurrent != $speedtestbest )); then
if (( $speedtestbest > 0 )); then
/bin/sed -i~ '/speedtestserver/d' /usr/local/share/nems/nems.conf
echo "speedtestserver=$speedtestbest" >> /usr/local/share/nems/nems.conf
echo " done."
else
echo " couldn't detect server."
fi
else
echo " no change."
fi


# 1 = Not allowed
# 2 = Allowed monthly
# 3 = Allowed semi-weekly
Expand Down

0 comments on commit 257578d

Please sign in to comment.