Skip to content

Instantly share code, notes, and snippets.

@1d10t
Last active August 26, 2018 23:08
Show Gist options
  • Save 1d10t/8a5b049f7d2a513f00bd59cf8d7ab699 to your computer and use it in GitHub Desktop.
Save 1d10t/8a5b049f7d2a513f00bd59cf8d7ab699 to your computer and use it in GitHub Desktop.
openwrt vpn up cron script
#!/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