#!/bin/sh
# for termination of the dsl connection

# be verbose
set -x

#echo "Start of main part at"
#date | xargs echo

#torctl stop
/etc/init.d/tor stop
sleep 3
# clean buggy tors
killall -9 tor&
echo "TOR is stopped"

# terminate the connection
#  cinternet --verbose --hangup
cinternet --interface-name=dsl0 -A --verbose --stop &
# restart the checking script via killall (+trap) and crontab 
killall -15 checkdsl
#killall -15 pppd &>/dev/null &
# nohup /bin/terminate smpppd &>/dev/null &

# Modem power cycle (4 s power off).
/bin/bash /root/c/8fa/1/modem_powercycle.sh &

rcprivoxy stop &
rcsquid stop

exit 0

