The modem reconnect works different for each operating system
For windows, the reconnect can be performed with the integrated batch reconnect
rasdial "CONECTIONNAME" /disconnect
ping www.google.de -n 8
rasdial "CONECTIONNAME" USERNAME PASSWORD
Enter “cmd /c” as interpreter
The tools pon
and poff
have to be added to /etc/sudoers
sudo su
echo "username ALL=(ALL) NOPASSWD: /usr/bin/pon">>/etc/sudoers
echo "username ALL=(ALL) NOPASSWD: /usr/bin/poff">>/etc/sudoers
batch reconnect to perform the following commands.
sudo poff dsl-provider
sudo pon dsl-provider
#!/usr/bin/osascript tell application "System Events" tell network preferences tell current location set aPPPoEService to a reference to (first service whose kind is 10) if exists aPPPoEService then set isConnected to connected of current configuration of aPPPoEService if isConnected then disconnect aPPPoEService end if end tell end tell end tell delay 10 tell application "System Events" tell network preferences tell current location set aPPPoEService to a reference to (first service whose kind is 10) if exists aPPPoEService then connect aPPPoEService end tell end tell end tell
tell application "System Events" tell network preferences disconnect service "verbindungsname" delay 2 connect service "verbindungsname" end tell end tell