Project

General

Profile

Download (1.92 KB) Statistics
| Branch: | Tag: | Revision:
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
[ "$PLATFORM" = "cdrom" ] || echo "installer)  Install pfSense to your hard drive" && echo
57

    
58
read -p "Enter a number: " opmode
59
echo
60

    
61
# see what the user has chosen
62
case ${opmode} in
63
0)
64
        exit && exit && logout
65
        ;;
66
1)
67
        /etc/rc.initial.setports
68
        ;;
69
2)
70
        /etc/rc.initial.setlanip
71
        ;;
72
3)
73
        /etc/rc.initial.password
74
        ;;
75
4)
76
        /etc/rc.initial.defaults
77
        ;;
78
5)
79
        /etc/rc.initial.reboot
80
        ;;
81
6)
82
        /etc/rc.initial.halt
83
        ;;
84
7)
85
        /etc/rc.initial.ping
86
        ;;
87
8)
88
	set prompt="%n\@%m\:%~# "
89
        /bin/tcsh
90
        ;;
91
9)
92
        /usr/local/sbin/pftop
93
        ;;
94
10)
95
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
96
	;;
97
installer)
98
	/scripts/lua_installer
99
	;;
100
99)
101
        if grep "$WORD" "$CONFIG"
102
        then
103
        	links "https://localhost"
104
        else
105
        	links "http://localhost"
106
        fi
107
        ;;
108
esac
109

    
110
sleep 1
111

    
112
done
113

    
114
fi
(30-30/52)