Last active
August 26, 2018 23:08
-
-
Save 1d10t/8a5b049f7d2a513f00bd59cf8d7ab699 to your computer and use it in GitHub Desktop.
openwrt vpn up cron script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
. /usr/share/libubox/jshn.sh | |
O=$(ubus -S call network.interface status "{ \"interface\" : \"vpn0\" }") | |
json_load "$O" | |
json_get_var up up | |
if [ "$up" == "0" ]; then | |
ifup vpn0 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment