diff --git a/check_uptime.sh b/check_uptime.sh index b5ae57e..3dd1fab 100755 --- a/check_uptime.sh +++ b/check_uptime.sh @@ -10,14 +10,16 @@ if uname | grep -q "BSD"; then total_uptime_seconds=$(($(date +%s) - boot_time_seconds)) else total_uptime_seconds=$(cat /proc/uptime | awk '{print $1}') - # echo "UNKNOWN: Unsupported system" - # exit 3 + total_uptime_seconds=$(printf "%.0f" "${total_uptime_seconds}") +#else +# echo "UNKNOWN: Unsupported system" +# exit 3 fi # Calculate uptime in days, hours, minutes, and seconds uptime_days=$((total_uptime_seconds / 86400)) -uptime_hours=$(( (total_uptime_seconds % 86400) / 3600 )) -uptime_minutes=$(( (total_uptime_seconds % 3600) / 60 )) +uptime_hours=$(((total_uptime_seconds % 86400) / 3600)) +uptime_minutes=$(((total_uptime_seconds % 3600) / 60)) uptime_seconds=$((total_uptime_seconds % 60)) # Print the result and perfdata