Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | Revision:
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 c0c27851 Scott Ullrich
# Set our operating platform
19
PLATFORM=`cat /etc/platform`
20
21 5b237745 Scott Ullrich
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 99227fad Scott Ullrich
else
35 5b237745 Scott Ullrich
36
# endless loop
37
while : ; do
38
39
/etc/rc.banner
40
41
# display a cheap menu
42 99227fad Scott Ullrich
echo "pfSense console setup"
43 5b237745 Scott Ullrich
echo "**********************"
44 e1a8dc99 Colin Smith
echo " 0)  Logout (SSH only)"
45
echo " 1)  Assign Interfaces"
46
echo " 2)  Set LAN IP address"
47 bfcb39c4 Scott Ullrich
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 4591490d Scott Ullrich
echo "10)  Traffic Logs"
55 5b237745 Scott Ullrich
echo
56 22fd6296 Scott Ullrich
[ "$PLATFORM" = "cdrom" ] || echo "installer)  Install pfSense to your hard drive" && echo
57 5b237745 Scott Ullrich
58
read -p "Enter a number: " opmode
59 4df08112 Scott Ullrich
echo
60 5b237745 Scott Ullrich
61
# see what the user has chosen
62
case ${opmode} in
63 debddb24 Scott Ullrich
0)
64 c900e2dc Scott Ullrich
        exit && exit && logout
65
        ;;
66 5b237745 Scott Ullrich
1)
67 c900e2dc Scott Ullrich
        /etc/rc.initial.setports
68
        ;;
69 5b237745 Scott Ullrich
2)
70 c900e2dc Scott Ullrich
        /etc/rc.initial.setlanip
71
        ;;
72 5b237745 Scott Ullrich
3)
73 c900e2dc Scott Ullrich
        /etc/rc.initial.password
74
        ;;
75 5b237745 Scott Ullrich
4)
76 c900e2dc Scott Ullrich
        /etc/rc.initial.defaults
77
        ;;
78 5b237745 Scott Ullrich
5)
79 c900e2dc Scott Ullrich
        /etc/rc.initial.reboot
80
        ;;
81 5b237745 Scott Ullrich
6)
82 c900e2dc Scott Ullrich
        /etc/rc.initial.halt
83
        ;;
84 5b237745 Scott Ullrich
7)
85 c900e2dc Scott Ullrich
        /etc/rc.initial.ping
86
        ;;
87 97a741af Scott Ullrich
8)
88 f3df8b0a Colin Smith
	set prompt="%n\@%m\:%~# "
89 9607c2a4 Scott Ullrich
        /bin/tcsh
90 c900e2dc Scott Ullrich
        ;;
91 97a741af Scott Ullrich
9)
92 c900e2dc Scott Ullrich
        /usr/local/sbin/pftop
93
        ;;
94 97a741af Scott Ullrich
10)
95 9228eaab Scott Ullrich
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
96
	;;
97 6e1fe0fc Scott Ullrich
installer)
98 236391d7 Scott Ullrich
	/scripts/lua_installer
99 6e1fe0fc Scott Ullrich
	;;
100 4591490d Scott Ullrich
99)
101 c900e2dc Scott Ullrich
        if grep "$WORD" "$CONFIG"
102
        then
103
        	links "https://localhost"
104
        else
105
        	links "http://localhost"
106
        fi
107
        ;;
108 5b237745 Scott Ullrich
esac
109
110 0c6b7ff1 Scott Ullrich
sleep 1
111
112 5b237745 Scott Ullrich
done
113
114
fi