-
Notifications
You must be signed in to change notification settings - Fork 0
/
ActiveZarHotSpot
82 lines (46 loc) · 1.99 KB
/
ActiveZarHotSpot
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# To EXECUTE: ./ActiveZarHotSpot
echo We are going to Activate the Zaragoza HotSpot ...
echo At the end Raspberry Pi will reboot
# ##########################################
echo -START- Add LINE: (denyinterfaces wlan0) AT THE END - IN PATH (/etc/dhcpcd.conf)
sed -i -e '$a\
denyinterfaces wlan0' /etc/dhcpcd.conf
echo -END-
# ##########################################
echo -START- Rename FILE: (/etc/network/interfaces) IN (/etc/network/interfaces.bak)
sudo mv /etc/network/interfaces /etc/network/interfaces.bak
echo -END-
# ##########################################
echo -START- Rename FILE: (/etc/network/interfaces.hotspot) IN (/etc/network/interfaces)
sudo mv /etc/network/interfaces.hotspot /etc/network/interfaces
echo -END-
# ##########################################
echo -START- Add LINE: (DAEMON_CONF="/etc/hostapd/hostapd.conf") AFTER (#DAEMON_CONF="") IN PATH (/etc/default/hostapd)
# Per scrivere dopo
sed -i '\|#DAEMON_CONF=""|a \
DAEMON_CONF="/etc/hostapd/hostapd.conf"' /etc/default/hostapd
echo -END-
# ##########################################
echo -START- Rename FILE: (/etc/dnsmasq.conf) IN (/etc/dnsmasq.conf.bak)
sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.bak
echo -END-
# ##########################################
echo -START- Rename FILE: (/etc/dnsmasq.conf.hotspot) IN (/etc/dnsmasq.conf)
sudo mv /etc/dnsmasq.conf.hotspot /etc/dnsmasq.conf
echo -END-
# ##########################################
echo -START- Add LINE: (net.ipv4.ip_forward=1) AFTER (#net.ipv4.ip_forward=1) IN PATH (/etc/sysctl.conf)
# Per scrivere dopo
sed -i '/#net.ipv4.ip_forward=1/a \
net.ipv4.ip_forward=1' /etc/sysctl.conf
echo -END-
# ##########################################
echo -START- Add LINE: (iptables-restore < /etc/iptables.ipv4.nat) BEFORE (exit 0) IN PATH (/etc/rc.local)
# Per scrivere dopo
sed -i '/exit\0/i \
iptables-restore < /etc/iptables.ipv4.nat' /etc/rc.local
echo -END-
# ##########################################
echo REBOOT
sudo reboot