summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2021-09-26 12:55:29 -0500
committerKyle K <kylek389@gmail.com>2021-09-26 12:55:29 -0500
commited5abb94563381580e8da5d393a220ab2340846f (patch)
tree50d526739afbff34ac657d788c4e566ab145ce96
parent03c9d0a48fd6e85babd13c72e45fe13a172814d2 (diff)
downloadconfigs-ed5abb94563381580e8da5d393a220ab2340846f.tar.gz
configs-ed5abb94563381580e8da5d393a220ab2340846f.tar.bz2
configs-ed5abb94563381580e8da5d393a220ab2340846f.zip
raspi router project
-rw-r--r--raspi/etc/rc.local22
-rw-r--r--raspi/usr/local/bin/wifi-restart-on-no-ping.sh12
2 files changed, 34 insertions, 0 deletions
diff --git a/raspi/etc/rc.local b/raspi/etc/rc.local
new file mode 100644
index 0000000..1ab728a
--- /dev/null
+++ b/raspi/etc/rc.local
@@ -0,0 +1,22 @@
+iwconfig wlan1 rate 18M AUTO
+iwconfig wlan1 frag 256
+iwconfig wlan1 rts 256
+
+iwconfig wlan1 retry short 31
+iwconfig wlan1 retry long 31
+
+#ifconfig wlan1 10.0.0.98 netmask 255.255.255.0
+#route add -net 10.0.0.0 netmask 255.255.255.0 dev wlan1
+#route add default gw 10.0.0.1 dev wlan1
+#route del default gw 0.0.0.0 dev eth0
+
+echo 'nameserver 1.1.1.1' > /etc/resolv.conf
+
+sysctl -w net.ipv6.conf.all.disable_ipv6=1
+sysctl -w net.ipv6.conf.default.disable_ipv6=1
+sysctl -w net.ipv6.conf.lo.disable_ipv6=1
+
+touch /boot/ssh
+/usr/local/bin/wifi-restart-on-no-ping.sh &
+
+exit 0
diff --git a/raspi/usr/local/bin/wifi-restart-on-no-ping.sh b/raspi/usr/local/bin/wifi-restart-on-no-ping.sh
new file mode 100644
index 0000000..b8190a1
--- /dev/null
+++ b/raspi/usr/local/bin/wifi-restart-on-no-ping.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+while true; do
+ ping -c 1 1.1.1.1
+ if [ "$?" -ne 0 ]; then
+ systemctl restart wpa_supplicant@wlan1.service
+ ifconfig wlan1 10.0.0.98 netmask 255.255.255.0
+ route add -net 10.0.0.0 netmask 255.255.255.0 dev wlan1
+ route add default gw 10.0.0.1 dev wlan1
+ route del default gw 0.0.0.0 dev eth0
+ fi
+sleep 1800
+done \ No newline at end of file