Jo Sidarta
Occasional Visitor
Hi,
Thanks to this thread and the developer of SSH Button app
I created a simple script that will allow you to check the router VPN client status from the Android phone.
I installed this on my family phone so that they can check whether the client VPN is running or not (against a specific smart tv) to ensure that they can watch certain regions of movies.
Steps:
1. Login to router through SSH
2. Create a new file and save it into a specific location (in my case: /jffs/scripts/chkVPN) - don't forget to chmod +x to the file
3. Download SSH Button app from Play Store
4. Create a new entry
For example to check VPN client 1, you would put the following command:
5. Create a widget from this SSH Button and you will be able to see the returned result
When VPN is running:
When VPN is not runnig:
Thanks to this thread and the developer of SSH Button app
I created a simple script that will allow you to check the router VPN client status from the Android phone.
I installed this on my family phone so that they can check whether the client VPN is running or not (against a specific smart tv) to ensure that they can watch certain regions of movies.
Steps:
1. Login to router through SSH
2. Create a new file and save it into a specific location (in my case: /jffs/scripts/chkVPN) - don't forget to chmod +x to the file
Bash:
#!/bin/sh
#This script will check VPN client status
#Usage: chkVPN <client number>
#E.g: chkVPN 1
#Returned results:
# - Exit 0 for running
# - Exit 1 for not running
status=$(nvram get vpn_client$1_state)
#If running, return 0 so that SSH-Button shows "OK" result
if [ $status -eq 0 ]
then
echo "VPN $1 is not running - exit 1"
exit 1
else
echo "VPN $1 is running - exit 0"
exit 0
fi
3. Download SSH Button app from Play Store
4. Create a new entry
For example to check VPN client 1, you would put the following command:
Code:
/jffs/scripts/chkVPN 1
5. Create a widget from this SSH Button and you will be able to see the returned result
When VPN is running:
When VPN is not runnig: