Project

General

Profile

Download (1.67 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 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
echo
52

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

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

    
99
done
100

    
101
fi
(29-29/51)