Skip to content

Commit

Permalink
change change
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Jan 26, 2024
1 parent ca00533 commit 7ea3543
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions advanced/Scripts/webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -579,16 +579,18 @@ ClearSpeedtestData() {
}

ChangeSpeedTestSchedule() {
if [[ "${args[2]}" =~ ^[0-9]+$ ]] && [ "${args[2]}" -ge 0 -a "${args[2]}" -le 24 ]; then
addOrEditKeyValPair "${setupVars}" "SPEEDTESTSCHEDULE" "${args[2]}"
SetService ${args[2]}
if [[ "${args[2]}" =~ ^[0-9]+(\.[0-9]+)?$ ]]; then # Accept any number of decimal places
if (( $(echo "${args[2]} >= 0" | bc -l) )); then
addOrEditKeyValPair "${setupVars}" "SPEEDTESTSCHEDULE" "${args[2]}"
SetService "${args[2]}"
fi
else
SPEEDTESTSCHEDULE=$(grep "SPEEDTESTSCHEDULE" "${setupVars}" | cut -f2 -d"=")
if [[ -z "${SPEEDTESTSCHEDULE}" ]]; then
addOrEditKeyValPair "${setupVars}" "SPEEDTESTSCHEDULE" "0"
fi
SPEEDTESTSCHEDULE=$(grep "SPEEDTESTSCHEDULE" "${setupVars}" | cut -f2 -d"=")
SetService ${SPEEDTESTSCHEDULE}
SetService "${SPEEDTESTSCHEDULE}"
fi
}

Expand Down

0 comments on commit 7ea3543

Please sign in to comment.