- # kill all old instances
- if [ $instances -gt 10 ] ; then
- ps -C sshd -o pid=,start_time=,command= |
- grep "$slice \[priv\]" |
- while read pid start_time command ; do
- start_time=$(date -d "$start_time" +%s)
- min=$(date -d "6 hours ago" +%s)
- if [ $start_time -lt $min ] ; then
- echo "* Killing $slice sshd pid $pid"
- kill -9 $pid
- fi
- done
- fi
+ # kill all old instances
+ if [ $instances -gt 10 ] ; then
+ ps -C sshd -o pid=,start_time=,command= |
+ grep "$slice \[priv\]" |
+ while read pid start_time command ; do
+ start_time=$(date -d "$start_time" +%s)
+ min=$(date -d "6 hours ago" +%s)
+ if [ $start_time -lt $min ] ; then
+ echo "* Killing $slice sshd pid $pid"
+ kill -9 $pid
+ fi
+ done
+ fi