if [ -e /etc/ppp/timestamp."$name" ]; then
now=$(date +%s)
when_up=$(< /etc/ppp/timestamp."$name")
durati - when_up]
durati $duration)
rm -f /etc/ppp/timestamp."$name"
else
durati
fi
# usuwamy pozostałości tunelu
iptables -t nat -D POSTROUTING -s $5 -j MASQUERADE
iptables -D FORWARD -s $5 -j ACCEPT
dev=$1
ip=$5
echo ".................................................................................."
echo ". `date` -- Disconected -- Interface: $dev"
echo ". `date` -- Disconected -- IP: $ip"
case $ip in
192.168.1.2) name="tomek"; subnet=192.168.22.0/24;;
192.168.1.3) name="sklep"; subnet=192.168.18.0/24;;
192.168.1.4) name="cymbark"; subnet=192.168.12.0/24;;
192.168.1.5) name="monika"; subnet=192.168.17.0/24;;
192.168.1.6) name="patryk"; subnet=192.168.13.0/24;;
192.168.1.7) name="aleksandra"; subnet=192.168.16.0/24;;
192.168.1.8) name="biurio"; subnet=192.168.14.0/24;;
192.168.1.9) name="goscinny"; subnet=192.168.11.0/24;;
192.168.1.10) name="kamila"; subnet=192.168.15.0/24;;
192.168.1.11) name="mateusz"; subnet=192.168.10.0/24;;
192.168.1.12) name="ania"; subnet=192.168.20.0/24;;
192.168.1.13) name="parking"; subnet=192.168.21.0/24;;
192.168.1.14) name="oleg"; subnet=192.168.24.0/24;;
192.168.1.15) name="rb2011"; subnet=192.168.25.0/24;;
*) logger -t ip-down "unknown ip $ip"; exit 1;;
esac
echo ". `date` -- Disconected -- User: $name"
echo ". `date` -- Disconected -- Subnet: $subnet"
echo ". -- Duration: $duration" # shows "Duration" but no time...
echo ".................................................................................."
#ip link set $dev alias "$name" # <----i dont understand or is not working is this good ?
#ip route del "$subnet" via $ip # <----i dont understand or is not working is this good ?
#ip route del "$subnet" via $ip dev $1 # <----i dont understand or is not working is this command good ?
#
logger -t ip-down "routes" to "$name" #<----i dont understand or is not working is this command good ?
exit 0
secs2hms() {
local -i t=$1 w=0 d=0 h=0 m=0 s=0
s=$[t % 60]; t=$[(t - s) / 60]
m=$[t % 60]; t=$[(t - m) / 60]
h=$[t % 24]; t=$[(t - h) / 24]
d=$t
if (( d > 0 )); then
echo "${d} d ${h} hr"
elif (( h > 0 )); then
echo "${h} hr ${m} min"
else
echo "${m} min ${s} sec"
fi
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}