D
Deleted member 27741
Guest
I have a super simple script that I want to modify and I know it will be child's play for you guys.
The below script outputs a 0 or a 2 depending on if the vpn is connected.
What I would like to do is make it a bit more sophisticated. So, if vpn_client1_state is 2 (connected) it would output something more informational like-
VPN client 1 connnected your ip address is <ip address>
Then if vpn_client1_state is 0 (disconnected), something like-
VPN client 2 disconnected your ip address is <ip address>
I think the reason I made it this simple in the first place is that I had trouble finding the WAN ip address when connected to the vpn client.
#!/bin/sh
logger -t $(basename $0) "STARTING SCRIPT, PARAMETER: $1"
echo "vpn_client1_state"
echo "CTRL+C to stop"
while true
do
nvram get "vpn_client1_state"
/bin/sleep 5s
done
The below script outputs a 0 or a 2 depending on if the vpn is connected.
What I would like to do is make it a bit more sophisticated. So, if vpn_client1_state is 2 (connected) it would output something more informational like-
VPN client 1 connnected your ip address is <ip address>
Then if vpn_client1_state is 0 (disconnected), something like-
VPN client 2 disconnected your ip address is <ip address>
I think the reason I made it this simple in the first place is that I had trouble finding the WAN ip address when connected to the vpn client.
#!/bin/sh
logger -t $(basename $0) "STARTING SCRIPT, PARAMETER: $1"
echo "vpn_client1_state"
echo "CTRL+C to stop"
while true
do
nvram get "vpn_client1_state"
/bin/sleep 5s
done