
Спасибо всем кто поучаствовал. Все работает, проверено на людях


#!/bin/sh
UNAME="$1"
TIMES=`rsh -l cisco_user cisco_ip session stat | grep -iw $UNAME | awk '{print $7}'`
TIMES2=`echo $TIMES|sed -e's/://g'`
if [ "$TIMES" ]; then
if [ "$TIMES2" -le "59" ]; then
exit
fi
exit
VPN_ID=`rsh -l cisco_user cisco_ip sh vpdn session stat | grep -iw $UNAME | awk '{print $3}'`
if [ "$VPN_ID" ]; then
rsh -l cisco_user cisco_ip clear vpdn tunnel pptp id $VPN_ID > /dev/null
exit
fi
fi
TIMES=`rsh -l cisco_user cisco_ip sh users | grep -iw $UNAME | awk '{print $4}'`
TIMES2=`echo $TIMES|sed -e's/://g'`
if [ "$TIMES" ]; then
if [ "$TIMES2" -le "59" ]; then
exit
fi
V_ID=`rsh -l cisco_user cisco_ip sh users | grep -iw $UNAME | awk '{print $1}'`
if [ "$V_ID" ]; then
MAC_ID=`rsh -l cisco_user cisco_ip sh pppoe session | grep -iw $V_ID | awk '{print $3}'`
fi
if [ "$MAC_ID" ]; then
rsh -l cisco_user cisco_ip clear pppoe rmac $MAC_ID > /dev/null
fi
fi