Skip to content

Instantly share code, notes, and snippets.

@geekman

geekman/gist:8098129

Created Dec 23, 2013
Embed
What would you like to do?
asusware script
#!/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
You can’t perform that action at this time.