Skip to content

Instantly share code, notes, and snippets.

@thuandt
Created April 24, 2020 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thuandt/b6b8eb731e340214fb3ea8c664cbb72d to your computer and use it in GitHub Desktop.
Save thuandt/b6b8eb731e340214fb3ea8c664cbb72d to your computer and use it in GitHub Desktop.
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