Project

General

Profile

Download (1.68 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2

    
3
# /etc/rc.initial
4
# part of pfSense by Scott Ullrich
5
# Copyright (C) 2004 Scott Ullrich, All rights reserved.
6
# originally based on m0n0wall (http://neon1.net/m0n0wall)
7
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
# All rights reserved.
9
# 301204:bkw Two declarations for case10
10
CONFIG="/cf/conf/config.xml"
11
WORD="https"
12
# make sure the user can't kill us by pressing Ctrl-C
13
trap : 2
14
trap : 3
15
trap : 4
16

    
17
if [ -r /var/etc/disableconsole ]; then
18

    
19
while : ; do
20

    
21
echo
22
echo
23
echo "*** Console menu disabled. ***"
24
echo
25

    
26
read tmp
27

    
28
done
29

    
30
else
31

    
32
# endless loop
33
while : ; do
34

    
35
/etc/rc.banner
36

    
37
# display a cheap menu
38
echo "pfSense console setup"
39
echo "**********************"
40
echo "0)  Logout if accessing via SSH"
41
echo "1)  Interfaces: assign network ports"
42
echo "2)  Set up LAN IP address"
43
echo "3)  Reset webGUI password"
44
echo "4)  Reset to factory defaults"
45
echo "5)  Reboot system"
46
echo "6)  Halt system"
47
echo "7)  Ping host"
48
echo "8)  Shell"
49
echo "9)  PFtop"
50
echo
51

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

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

    
98
done
99

    
100
fi
(25-25/43)