1 |
5b237745
|
Scott Ullrich
|
#!/bin/sh
|
2 |
|
|
|
3 |
1b8df11b
|
Bill Marquette
|
# $Id$
|
4 |
5b237745
|
Scott Ullrich
|
# /etc/rc.initial
|
5 |
99227fad
|
Scott Ullrich
|
# part of pfSense by Scott Ullrich
|
6 |
e5cd29a0
|
Scott Ullrich
|
# Copyright (C) 2004 Scott Ullrich, All rights reserved.
|
7 |
|
|
# originally based on m0n0wall (http://neon1.net/m0n0wall)
|
8 |
5b237745
|
Scott Ullrich
|
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
9 |
|
|
# All rights reserved.
|
10 |
ed7bcd2e
|
bkw
|
# 301204:bkw Two declarations for case10
|
11 |
c900e2dc
|
Scott Ullrich
|
CONFIG="/cf/conf/config.xml"
|
12 |
|
|
WORD="https"
|
13 |
5b237745
|
Scott Ullrich
|
# make sure the user can't kill us by pressing Ctrl-C
|
14 |
|
|
trap : 2
|
15 |
|
|
trap : 3
|
16 |
|
|
trap : 4
|
17 |
|
|
|
18 |
|
|
if [ -r /var/etc/disableconsole ]; then
|
19 |
|
|
|
20 |
|
|
while : ; do
|
21 |
|
|
|
22 |
|
|
echo
|
23 |
|
|
echo
|
24 |
|
|
echo "*** Console menu disabled. ***"
|
25 |
|
|
echo
|
26 |
|
|
|
27 |
|
|
read tmp
|
28 |
|
|
|
29 |
|
|
done
|
30 |
|
|
|
31 |
99227fad
|
Scott Ullrich
|
else
|
32 |
5b237745
|
Scott Ullrich
|
|
33 |
|
|
# endless loop
|
34 |
|
|
while : ; do
|
35 |
|
|
|
36 |
|
|
/etc/rc.banner
|
37 |
|
|
|
38 |
|
|
# display a cheap menu
|
39 |
99227fad
|
Scott Ullrich
|
echo "pfSense console setup"
|
40 |
5b237745
|
Scott Ullrich
|
echo "**********************"
|
41 |
c900e2dc
|
Scott Ullrich
|
echo "0) Logout if accessing via SSH"
|
42 |
|
|
echo "1) Interfaces: assign network ports"
|
43 |
|
|
echo "2) Set up LAN IP address"
|
44 |
|
|
echo "3) Reset webGUI password"
|
45 |
|
|
echo "4) Reset to factory defaults"
|
46 |
|
|
echo "5) Reboot system"
|
47 |
|
|
echo "6) Halt system"
|
48 |
|
|
echo "7) Ping host"
|
49 |
|
|
echo "8) Shell"
|
50 |
|
|
echo "9) PFtop"
|
51 |
5b237745
|
Scott Ullrich
|
echo
|
52 |
|
|
|
53 |
|
|
read -p "Enter a number: " opmode
|
54 |
4df08112
|
Scott Ullrich
|
echo
|
55 |
5b237745
|
Scott Ullrich
|
|
56 |
|
|
# see what the user has chosen
|
57 |
|
|
case ${opmode} in
|
58 |
debddb24
|
Scott Ullrich
|
0)
|
59 |
c900e2dc
|
Scott Ullrich
|
exit && exit && logout
|
60 |
|
|
;;
|
61 |
5b237745
|
Scott Ullrich
|
1)
|
62 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.setports
|
63 |
|
|
;;
|
64 |
5b237745
|
Scott Ullrich
|
2)
|
65 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.setlanip
|
66 |
|
|
;;
|
67 |
5b237745
|
Scott Ullrich
|
3)
|
68 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.password
|
69 |
|
|
;;
|
70 |
5b237745
|
Scott Ullrich
|
4)
|
71 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.defaults
|
72 |
|
|
;;
|
73 |
5b237745
|
Scott Ullrich
|
5)
|
74 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.reboot
|
75 |
|
|
;;
|
76 |
5b237745
|
Scott Ullrich
|
6)
|
77 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.halt
|
78 |
|
|
;;
|
79 |
5b237745
|
Scott Ullrich
|
7)
|
80 |
c900e2dc
|
Scott Ullrich
|
/etc/rc.initial.ping
|
81 |
|
|
;;
|
82 |
97a741af
|
Scott Ullrich
|
8)
|
83 |
f3df8b0a
|
Colin Smith
|
set prompt="%n\@%m\:%~# "
|
84 |
9607c2a4
|
Scott Ullrich
|
/bin/tcsh
|
85 |
c900e2dc
|
Scott Ullrich
|
;;
|
86 |
97a741af
|
Scott Ullrich
|
9)
|
87 |
c900e2dc
|
Scott Ullrich
|
/usr/local/sbin/pftop
|
88 |
|
|
;;
|
89 |
97a741af
|
Scott Ullrich
|
10)
|
90 |
c900e2dc
|
Scott Ullrich
|
if grep "$WORD" "$CONFIG"
|
91 |
|
|
then
|
92 |
|
|
links "https://localhost"
|
93 |
|
|
else
|
94 |
|
|
links "http://localhost"
|
95 |
|
|
fi
|
96 |
|
|
;;
|
97 |
5b237745
|
Scott Ullrich
|
esac
|
98 |
|
|
|
99 |
|
|
done
|
100 |
|
|
|
101 |
|
|
fi
|