Permalink
Browse files

AP script tested and working

  • Loading branch information...
ericbuzan committed Jun 3, 2017
1 parent 00ed246 commit 192d0971e30766f26c19374e7c2b6d420f1bb666
Showing with 25 additions and 20 deletions.
  1. 0 apfiles/ap_active
  2. +1 −1 apfiles/dhcpcd.conf
  3. +1 −1 apfiles/hostapd
  4. +1 −8 apfiles/interfaces
  5. +1 −1 apfiles/rc.local
  6. +1 −0 apfiles/sysctl.conf
  7. +8 −5 disable_ap.sh
  8. +12 −4 enable_ap.sh
View
No changes.
View
@@ -40,6 +40,6 @@ slaac private
# server, but it should not be run by default.
nohook lookup-hostname
#used to turn Pi into an access point
#Access point for JoustMania
denyinterfaces wlan0
View
@@ -17,4 +17,4 @@ DAEMON_CONF="/etc/hostapd/hostapd.conf"
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS="/etc/hostapd/hostapd.conf"
#DAEMON_OPTS=""
View
@@ -11,6 +11,7 @@ iface lo inet loopback
iface eth0 inet manual
#Access point for JoustMania
allow-hotplug wlan0
iface wlan0 inet static
address 172.24.1.1
@@ -22,11 +23,3 @@ iface wlan0 inet static
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan0
iface wlan0 inet static
address 172.24.1.1
netmask 255.255.255.0
network 172.24.1.0
broadcast 172.24.1.255
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
View
@@ -17,7 +17,7 @@ if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
#Pi access point
#Access point for JoustMania
iptables-restore < /etc/iptables.ipv4.nat
exit 0
View
@@ -25,6 +25,7 @@
#net.ipv4.tcp_syncookies=1
# Uncomment the next line to enable packet forwarding for IPv4
#Uncommented for JoustMania
net.ipv4.ip_forward=1
# Uncomment the next line to enable packet forwarding for IPv6
View
13 disable_ap.sh 100644 → 100755
@@ -1,9 +1,15 @@
if [ "$EUID" -ne 0 ]
if [ "$EUID" -ne 0 ];
then echo "This script needs root... run with sudo"
exit
fi
rm ./apfiles/ap_active
update-rc.d hostapd disable
update-rc.d dnsmasq disable
mv /etc/dhcpcd.conf.bak /etc/dhcpcd.conf
chown :pi /etc/dhcpcd.conf
mv /etc/network/interfaces.bak /etc/network/interfaces
@@ -17,7 +23,4 @@ mv /etc/sysctl.conf.bak /etc/sysctl.conf
mv /etc/rc.local.bak /etc/rc.local
sudo service hostapd stop
sudo service dnsmasq stop
reboot
reboot
View
@@ -1,12 +1,20 @@
if [ "$EUID" -ne 0 ]
if [ "$EUID" -ne 0 ];
then echo "This script needs root... run with sudo"
exit
fi
if [ -f ./apfiles/ap_active ]
then echo "Script already run"
exit
fi
touch ./apfiles/ap_active
apt-get install dnsmasq hostapd
mv /etc/dhcpcd.conf /etc/dhcpcd.conf.bak
cp ./apfiles/dhcpcd.conf /etc/dhcpcd.conf
chown :pi /etc/dhcpcd.conf
mv /etc/network/interfaces /etc/network/interfaces.bak
cp ./apfiles/interfaces /etc/network/interfaces
@@ -34,7 +42,7 @@ sh -c "iptables-save > /etc/iptables.ipv4.nat"
mv /etc/rc.local /etc/rc.local.bak
cp ./apfiles/rc.local /etc/rc.local
sudo service hostapd enable
sudo service dnsmasq enable
update-rc.d hostapd enable
update-rc.d dnsmasq enable
reboot
reboot

0 comments on commit 192d097

Please sign in to comment.