1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| mv /config/scripts/reboot_pppoe_connection/reboot_pppoe_connection.sh{,.bak}
ls /config/scripts/reboot_pppoe_connection/
tee -a /config/scripts/reboot_pppoe_connection/reboot_pppoe_connection.sh << "EOF"
#!/bin/vbash
source /opt/vyatta/etc/functions/script-template
logfile=/var/log/reconnect_pppoe0.log
echo "==================================" >> ${logfile} 2>&1
date '+%Y-%m-%d %H:%M:%S' >> ${logfile} 2>&1
run show interfaces | grep -A 2 ppoe0 | tee >> ${logfile} 2>&1
run disconnect interface pppoe0 | tee >> ${logfile} 2>&1
run connect interface pppoe0 | tee >> ${logfile} 2>&1
echo "sleep 3 second..." >> ${logfile} 2>&1
sleep 3
run show interfaces | grep -A 2 ppoe0 | tee >> ${logfile} 2>&1
date '+%Y-%m-%d %H:%M:%S' >> ${logfile} 2>&1
echo "==================================" >> ${logfile} 2>&1
exit
EOF
|