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
|
# 301204:bkw Two declarations for case10
|
11
|
CONFIG="/cf/conf/config.xml"
|
12
|
WORD="https"
|
13
|
# make sure the user can't kill us by pressing Ctrl-C
|
14
|
trap : 2
|
15
|
trap : 3
|
16
|
trap : 4
|
17
|
|
18
|
# Set our operating platform
|
19
|
PLATFORM=`cat /etc/platform`
|
20
|
|
21
|
if [ -r /var/etc/disableconsole ]; then
|
22
|
|
23
|
while : ; do
|
24
|
|
25
|
echo
|
26
|
echo
|
27
|
echo "*** Console menu disabled. ***"
|
28
|
echo
|
29
|
|
30
|
read tmp
|
31
|
|
32
|
done
|
33
|
|
34
|
else
|
35
|
|
36
|
# endless loop
|
37
|
while : ; do
|
38
|
|
39
|
/etc/rc.banner
|
40
|
|
41
|
# display a cheap menu
|
42
|
echo "pfSense console setup"
|
43
|
echo "**********************"
|
44
|
echo " 0) Logout (SSH only)"
|
45
|
echo " 1) Assign Interfaces"
|
46
|
echo " 2) Set LAN IP address"
|
47
|
echo " 3) Reset webGUI password"
|
48
|
echo " 4) Reset to factory defaults"
|
49
|
echo " 5) Reboot system"
|
50
|
echo " 6) Halt system"
|
51
|
echo " 7) Ping host"
|
52
|
echo " 8) Shell"
|
53
|
echo " 9) PFtop"
|
54
|
echo "10) Traffic Logs"
|
55
|
echo
|
56
|
|
57
|
if [ "$PLATFORM" = "cdrom" ]; then
|
58
|
echo "Run installer for the stable BSD Installer"
|
59
|
echo "Run installer.lua for the new experimental BSD Installer"
|
60
|
echo
|
61
|
fi
|
62
|
|
63
|
read -p "Enter an option: " opmode
|
64
|
echo
|
65
|
|
66
|
# see what the user has chosen
|
67
|
case ${opmode} in
|
68
|
0)
|
69
|
exit && exit && logout
|
70
|
;;
|
71
|
1)
|
72
|
/etc/rc.initial.setports
|
73
|
;;
|
74
|
2)
|
75
|
/etc/rc.initial.setlanip
|
76
|
;;
|
77
|
3)
|
78
|
/etc/rc.initial.password
|
79
|
;;
|
80
|
4)
|
81
|
/etc/rc.initial.defaults
|
82
|
;;
|
83
|
5)
|
84
|
/etc/rc.initial.reboot
|
85
|
;;
|
86
|
6)
|
87
|
/etc/rc.initial.halt
|
88
|
;;
|
89
|
7)
|
90
|
/etc/rc.initial.ping
|
91
|
;;
|
92
|
8)
|
93
|
set prompt="%n\@%m\:%~# "
|
94
|
/bin/tcsh
|
95
|
;;
|
96
|
9)
|
97
|
/usr/local/sbin/pftop
|
98
|
;;
|
99
|
10)
|
100
|
/usr/sbin/tcpdump -n -e -ttt -i pflog0
|
101
|
;;
|
102
|
installer.lua)
|
103
|
/scripts/lua_installer
|
104
|
;;
|
105
|
installer)
|
106
|
/scripts/installer.sh
|
107
|
;;
|
108
|
99)
|
109
|
if grep "$WORD" "$CONFIG"
|
110
|
then
|
111
|
links "https://localhost"
|
112
|
else
|
113
|
links "http://localhost"
|
114
|
fi
|
115
|
;;
|
116
|
esac
|
117
|
|
118
|
sleep 1
|
119
|
|
120
|
done
|
121
|
|
122
|
fi
|