Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OpenWRT setup
#!/bin/sh
# Setup OpenWRT router
set -e
if [ -f /etc/upgraded ]; then
echo "router has been configured properly!"
else
if ping -q -c 1 -W 1 8.8.8.8 >/dev/null; then
echo "start reconfigure router"
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "install recommended packages for mrtux-router"
opkg update
opkg install luci-app-wireguard luci-app-uhttpd luci-ssl luci-app-watchcat kmod-sched-cake dnscrypt-proxy2 openvpn-openssl
echo "remove conffile"
rm /etc/dnscrypt-proxy2/dnscrypt-proxy.toml-opkg
echo "create record file"
touch /etc/upgraded
echo "reboot to apply new configuration"
reboot
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment