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