From 49a8f558596d2a287793e12ebac60c026f608df1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 27 Apr 2015 18:35:51 -0400 Subject: fix offlineimap-killer There were decimal points in the output of pid_uptime, causing a syntax error. --- offlineimap-killer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offlineimap-killer.sh b/offlineimap-killer.sh index 91f9509..7b88b2f 100644 --- a/offlineimap-killer.sh +++ b/offlineimap-killer.sh @@ -20,7 +20,7 @@ main() { local pids=($(pgrep -x offlineimap)) local pid for pid in "${pids[@]}"; do - declare -i uptime=$(pid_uptime $pid) + declare -i uptime=$(pid_uptime $pid|cut -d. -f1) if [[ "$uptime" -gt "$pid" ]]; then printf 'Killing %d which has been running for %d seconds' "$pid" "$uptime" kill -9 "$pid" -- cgit v1.2.3