#!/bin/bash

#used for cli command "set system services ssh idle timeout"
#input :
#         $1: 
#            ssh idle timeout value
# no output var
sed -i "s/^ClientAliveInterval.*/`echo "ClientAliveInterval "$1`/" /etc/ssh/sshd_config

# reload sshd configuration while not disturb current sessions
#kill -HUP `ps | grep -v grep | grep '/usr/sbin/sshd' | awk '{print $1}'`
#/etc/init.d/ssh reload
if [ -f /var/run/sshd.pid ];then
    /etc/init.d/ssh reload > /dev/null
fi
exit 0
