Created
December 23, 2013 14:34
-
-
Save geekman/8098129 to your computer and use it in GitHub Desktop.
asusware script
This file contains hidden or 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 | |
| # ASUS app autorun script | |
| # $1: device name, $2: mounted path. | |
| # wait for everything to be up first | |
| i=0 | |
| while [ $i -le 20 ]; do | |
| success_start_service=`nvram get success_start_service` | |
| if [ "$success_start_service" == "1" ]; then | |
| break | |
| fi | |
| i=$(($i+1)) | |
| echo "autorun APP: wait $i seconds..." | |
| sleep 1 | |
| done | |
| # get interface names | |
| LAN_IFNAME=`nvram get lan_ifname` | |
| WAN_IFNAME=`nvram get wan0_ifname` | |
| WAN_GATEWAY=`nvram get wan_gateway` | |
| # start dhcp-fwd | |
| mkdir /var/run/dhcp-fwd | |
| sed -e "s/LAN_IFNAME/$LAN_IFNAME/g; s/WAN_IFNAME/$WAN_IFNAME/g; s/WAN_GATEWAY/$WAN_GATEWAY/g;" /opt/dhcp-fwd.conf > /tmp/dhcp-fwd.conf | |
| /opt/dhcp-fwd -c /tmp/dhcp-fwd.conf | |
| # start mdns-repeater | |
| /opt/mdns-repeater $LAN_IFNAME $WAN_IFNAME | |
| # not sure why we must do this for RADIUS to work | |
| # is it because of our dhcp-fwd, or some bug in Asus router?? | |
| /sbin/restart_wireless |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment