1
|
#!/bin/sh
|
2
|
|
3
|
# $Id$
|
4
|
# /etc/rc.initial
|
5
|
# part of pfSense by Scott Ullrich
|
6
|
# Copyright (C) 2004 Scott Ullrich, All rights reserved.
|
7
|
# originally based on m0n0wall (http://neon1.net/m0n0wall)
|
8
|
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
9
|
# All rights reserved.
|
10
|
|
11
|
if [ -e /usr/local/etc/rc.d/dev_bootstrap.sh ]; then
|
12
|
echo
|
13
|
echo "A developer bootstrap is most likely in progress."
|
14
|
echo "This operation bootstraps all developer files from"
|
15
|
echo "pfSense.com and also FreeBSD.org and builds a ISO"
|
16
|
echo "to verify the environment is sane."
|
17
|
echo
|
18
|
echo "During this process, /usr/src is automatically downloaded"
|
19
|
echo "and many supporting files are built, installed, etc."
|
20
|
echo
|
21
|
echo -n "Would you like to tail the progress (y/n) [n]? "
|
22
|
read ANSWER
|
23
|
if [ "$ANSWER" = "y" ]; then
|
24
|
echo
|
25
|
echo "Tailing developer bootstrap process."
|
26
|
echo
|
27
|
echo "Press CTRL-C to abort."
|
28
|
echo
|
29
|
echo "Note, this tailing process will exit once the operation is completed."
|
30
|
echo
|
31
|
tail -f /tmp/bootup_messages
|
32
|
fi
|
33
|
fi
|
34
|
|
35
|
# make sure the user can't kill us by pressing Ctrl-C,
|
36
|
# ctrl-z, etc.
|
37
|
#trap : 2
|
38
|
#trap : 3
|
39
|
#trap : 4
|
40
|
|
41
|
CONFIG="/cf/conf/config.xml"
|
42
|
WORD="https"
|
43
|
|
44
|
# Document which terminal launched last
|
45
|
# so we can attempt to track down the
|
46
|
# rc.initial respawn issues.
|
47
|
echo `tty` > /tmp/last_term_seen
|
48
|
|
49
|
# Set our operating platform
|
50
|
PLATFORM=`cat /etc/platform`
|
51
|
|
52
|
# endless loop
|
53
|
while : ; do
|
54
|
|
55
|
if [ -f /tmp/ttybug ]; then
|
56
|
rm /tmp/ttybug
|
57
|
exit && exit && logout
|
58
|
fi
|
59
|
|
60
|
/etc/rc.banner
|
61
|
|
62
|
# display a cheap menu
|
63
|
echo
|
64
|
echo
|
65
|
echo " pfSense console setup "
|
66
|
echo "***********************"
|
67
|
echo " 0) Logout (SSH only)"
|
68
|
echo " 1) Assign Interfaces"
|
69
|
echo " 2) Set LAN IP address"
|
70
|
echo " 3) Reset webConfigurator password"
|
71
|
echo " 4) Reset to factory defaults"
|
72
|
echo " 5) Reboot system"
|
73
|
echo " 6) Halt system"
|
74
|
echo " 7) Ping host"
|
75
|
echo " 8) Shell"
|
76
|
echo " 9) PFtop"
|
77
|
echo "10) Filter Logs"
|
78
|
echo "11) Restart webConfigurator"
|
79
|
for i in /var/db/pfi/capable_*; do
|
80
|
if [ -f $i -a ! -L /cf/conf ]; then
|
81
|
echo "98) Move configuration file to removable device"
|
82
|
break
|
83
|
fi
|
84
|
done
|
85
|
|
86
|
if [ "$PLATFORM" = "cdrom" ]; then
|
87
|
echo "99) Install pfSense to a hard drive/memory drive, etc."
|
88
|
echo
|
89
|
fi
|
90
|
|
91
|
echo
|
92
|
read -p "Enter an option: " opmode
|
93
|
echo
|
94
|
|
95
|
# see what the user has chosen
|
96
|
case ${opmode} in
|
97
|
0)
|
98
|
exit && exit && logout
|
99
|
;;
|
100
|
1)
|
101
|
/etc/rc.initial.setports
|
102
|
;;
|
103
|
2)
|
104
|
/etc/rc.initial.setlanip
|
105
|
;;
|
106
|
3)
|
107
|
/etc/rc.initial.password
|
108
|
;;
|
109
|
4)
|
110
|
/etc/rc.initial.defaults
|
111
|
;;
|
112
|
5)
|
113
|
/etc/rc.initial.reboot
|
114
|
;;
|
115
|
6)
|
116
|
/etc/rc.initial.halt
|
117
|
;;
|
118
|
7)
|
119
|
/etc/rc.initial.ping
|
120
|
;;
|
121
|
8)
|
122
|
/bin/tcsh
|
123
|
;;
|
124
|
9)
|
125
|
/usr/local/sbin/pftop
|
126
|
;;
|
127
|
10)
|
128
|
/usr/sbin/tcpdump -n -e -ttt -i pflog0
|
129
|
;;
|
130
|
11)
|
131
|
/etc/rc.restart_webgui
|
132
|
;;
|
133
|
12)
|
134
|
/etc/rc.banner
|
135
|
;;
|
136
|
98)
|
137
|
if [ ! -f /tmp/config_moved ]; then
|
138
|
/etc/rc.initial.store_config_to_removable_device
|
139
|
fi
|
140
|
;;
|
141
|
99)
|
142
|
if [ -e /dev/ukbd0 ]; then
|
143
|
env TERM=cons25 /scripts/lua_installer
|
144
|
else
|
145
|
/scripts/lua_installer
|
146
|
fi
|
147
|
;;
|
148
|
100)
|
149
|
if grep "$WORD" "$CONFIG"
|
150
|
then
|
151
|
links "https://localhost"
|
152
|
else
|
153
|
links "http://localhost"
|
154
|
fi
|
155
|
;;
|
156
|
"")
|
157
|
echo -n "Press CTRL-C to continue."
|
158
|
sleep 1000000
|
159
|
;;
|
160
|
esac
|
161
|
|
162
|
done
|
163
|
|