Project

General

Profile

Download (1.73 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
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
else
32

    
33
# endless loop
34
while : ; do
35

    
36
/etc/rc.banner
37

    
38
# display a cheap menu
39
echo "pfSense console setup"
40
echo "**********************"
41
echo " 0)  Logout (SSH only)"
42
echo " 1)  Assign Interfaces"
43
echo " 2)  Set 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
echo "10)  Traffic Logs"
52
echo
53

    
54
read -p "Enter a number: " opmode
55
echo
56

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

    
103
sleep 1
104

    
105
done
106

    
107
fi
(30-30/52)