Skip to content

Commit

Permalink
extra if
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Feb 9, 2024
1 parent dc8a668 commit 3de5728
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions advanced/Scripts/webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,7 @@ generate_systemd_calendar() {
}

generate_cron_schedule() {
local interval_hours="$1"
local total_seconds=$(echo "$interval_hours * 3600" | bc)
local total_seconds=$(echo "$1 * 3600" | bc)
local schedule_script="/opt/pihole/speedtestmod/schedule_check.sh"

if (( $(echo "$total_seconds < 60" | bc -l) )) && (( $(echo "$total_seconds > 0" | bc -l) )); then
Expand All @@ -606,7 +605,7 @@ generate_cron_schedule() {

if [[ ! "$total_seconds" =~ ^-?([0-9]+(\.[0-9]*)?|\.[0-9]+)$ ]]; then
total_seconds="nan"
else
elif (( $(echo "$total_seconds > 0" | bc -l) )); then
remainder=$(echo "$total_seconds % 60" | bc)
if [ $(echo "$remainder < 30" | bc) -eq 1 ]; then
total_seconds=$(echo "$total_seconds - $remainder" | bc)
Expand Down

0 comments on commit 3de5728

Please sign in to comment.