forked from cr/mkPirateBox
-
Notifications
You must be signed in to change notification settings - Fork 15
/
postinst
executable file
·51 lines (41 loc) · 1.16 KB
/
postinst
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
#!/bin/ash
# include PirateBox shared functionality
. /etc/piratebox.common
# check if root password is not set yet
if grep '^root:!:' /etc/passwd >/dev/null
then
echo "Please set a decent root password..."
while ! passwd
do
echo "Try again!"
done
echo "Next time you log in, you must use ssh."
fi
# disable web interface, start PirateBox instead
/etc/init.d/uhttpd stop
/etc/init.d/uhttpd disable
/etc/init.d/luci_fixtime stop
/etc/init.d/luci_fixtime disable
/etc/init.d/luci_dhcp_migrate stop
/etc/init.d/luci_dhcp_migrate disable
/etc/init.d/piratebox enable
# configure USB, network
/etc/init.d/piratebox setup
# prepare USB partition and install PirateBox
/etc/init.d/piratebox init
/etc/init.d/piratebox update
# activate config changes
/etc/init.d/firewall restart
/etc/init.d/dnsmasq restart
wifi
# start PirateBox service
/etc/init.d/piratebox start
# give some user feedback
echo
echo "PirateBox wireless SSID: $pb_wireless_ssid"
echo "PirateBox DNS and hostname: $pb_hostname"
echo "PirateBox LAN IP address: $pb_ip"
echo "PirateBox shared directory: $pd_share"
echo
echo "Setup complete, PirateBox started."
echo "You can remove the WAN connection now."