Project

General

Profile

Download (2.17 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 "10)  Invoke Auto Upgrade"
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
        echo "Downloading $FMFILENAME from $FMBASEURL ..." | logger -p daemon.info -i -t AutoUpgrade
92
        /usr/bin/fetch -o /tmp/latest.tgz $FETCHFILENAME | logger -p daemon.info -i -t AutoUpgrade
93
        echo "Downloading $FMFILENAME.md5 from $FMBASEURL ..."  | logger -p daemon.info -i -t AutoUpgrade
94
        /usr/bin/fetch -o /tmp/latest.tgz.md5 $FETCHFILENAME.md5 | logger -p daemon.info -i -t AutoUpgrade        
95
        /etc/rc.firmware_auto
96
        ;;
97
11)
98
        if grep "$WORD" "$CONFIG"
99
        then
100
        	links "https://localhost"
101
        else
102
        	links "http://localhost"
103
        fi
104
        ;;
105
esac
106

    
107
done
108

    
109
fi
(29-29/51)