mirror of
https://gitlab.com/hacklab01/pivilion.git
synced 2025-04-29 16:47:17 +00:00
update for captive
This commit is contained in:
parent
b18157ae7d
commit
ea3d3998c5
@ -1,24 +1,20 @@
|
|||||||
#!/bin/sh -e
|
#!/bin/bash
|
||||||
#
|
|
||||||
# rc.local
|
|
||||||
#
|
|
||||||
# This script is executed at the end of each multiuser runlevel.
|
|
||||||
# Make sure that the script will "exit 0" on success or any other
|
|
||||||
# value on error.
|
|
||||||
#
|
|
||||||
# In order to enable or disable this script just change the execution
|
|
||||||
# bits.
|
|
||||||
#
|
|
||||||
# By default this script does nothing.
|
|
||||||
|
|
||||||
# Print the IP address
|
service apache2 start
|
||||||
_IP=$(hostname -I) || true
|
sleep 1
|
||||||
if [ "$_IP" ]; then
|
ifconfig wlan0 down
|
||||||
printf "My IP address is %s\n" "$_IP"
|
ifconfig wlan0 up
|
||||||
fi
|
sleep 1
|
||||||
# Display onion domain in MOTD
|
hostapd -B /etc/hostapd/hostapd.conf
|
||||||
cat /var/lib/tor/hidden_service/hostname > /home/pi/torname
|
sleep 2
|
||||||
hostapd -d /etc/hostapd/hostapd.conf
|
ifconfig br0 up
|
||||||
|
ifconfig br0 10.1.1.1 netmask 255.255.255.0
|
||||||
|
sysctl net.ipv4.ip_forward=1
|
||||||
|
iptables --flush
|
||||||
|
iptables -t nat --flush
|
||||||
|
iptables -t nat -A PREROUTING -i br0 -p udp -m udp --dport 53 -j DNAT --to-destination 10.1.1.1:53
|
||||||
|
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.1.1.1:80
|
||||||
|
iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp --dport 443 -j DNAT --to-destination 10.1.1.1:80
|
||||||
|
iptables -t nat -A POSTROUTING -j MASQUERADE
|
||||||
|
service dnsmasq start
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user