Project

General

Profile

Download (2.04 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 2730fde3 Scott Ullrich
57
if [ "$PLATFORM" = "cdrom" ]; then
58 88478ff8 Scott Ullrich
    echo "Run installer for the stable BSD Installer"
59
    echo "Run installer.lua for the new experimental BSD Installer"
60 2730fde3 Scott Ullrich
    echo
61
fi
62 5b237745 Scott Ullrich
63 568af189 Colin Smith
read -p "Enter an option: " opmode
64 4df08112 Scott Ullrich
echo
65 5b237745 Scott Ullrich
66
# see what the user has chosen
67
case ${opmode} in
68 debddb24 Scott Ullrich
0)
69 c900e2dc Scott Ullrich
        exit && exit && logout
70
        ;;
71 5b237745 Scott Ullrich
1)
72 c900e2dc Scott Ullrich
        /etc/rc.initial.setports
73
        ;;
74 5b237745 Scott Ullrich
2)
75 c900e2dc Scott Ullrich
        /etc/rc.initial.setlanip
76
        ;;
77 5b237745 Scott Ullrich
3)
78 c900e2dc Scott Ullrich
        /etc/rc.initial.password
79
        ;;
80 5b237745 Scott Ullrich
4)
81 c900e2dc Scott Ullrich
        /etc/rc.initial.defaults
82
        ;;
83 5b237745 Scott Ullrich
5)
84 c900e2dc Scott Ullrich
        /etc/rc.initial.reboot
85
        ;;
86 5b237745 Scott Ullrich
6)
87 c900e2dc Scott Ullrich
        /etc/rc.initial.halt
88
        ;;
89 5b237745 Scott Ullrich
7)
90 c900e2dc Scott Ullrich
        /etc/rc.initial.ping
91
        ;;
92 97a741af Scott Ullrich
8)
93 f3df8b0a Colin Smith
	set prompt="%n\@%m\:%~# "
94 9607c2a4 Scott Ullrich
        /bin/tcsh
95 c900e2dc Scott Ullrich
        ;;
96 97a741af Scott Ullrich
9)
97 c900e2dc Scott Ullrich
        /usr/local/sbin/pftop
98
        ;;
99 97a741af Scott Ullrich
10)
100 9228eaab Scott Ullrich
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
101
	;;
102 0f7bf00f Scott Ullrich
installer.lua)
103 236391d7 Scott Ullrich
	/scripts/lua_installer
104 6e1fe0fc Scott Ullrich
	;;
105 0f7bf00f Scott Ullrich
installer)
106 f26efd50 Scott Ullrich
	/scripts/installer.sh
107 0f7bf00f Scott Ullrich
	;;
108 4591490d Scott Ullrich
99)
109 c900e2dc Scott Ullrich
        if grep "$WORD" "$CONFIG"
110
        then
111
        	links "https://localhost"
112
        else
113
        	links "http://localhost"
114
        fi
115
        ;;
116 5b237745 Scott Ullrich
esac
117
118 0c6b7ff1 Scott Ullrich
sleep 1
119
120 5b237745 Scott Ullrich
done
121
122
fi