Project

General

Profile

Download (2.08 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

    
11
# make sure the user can't kill us by pressing Ctrl-C,
12
# ctrl-z, etc.
13
trap : 2
14
trap : 3
15
trap : 4
16

    
17
CONFIG="/cf/conf/config.xml"
18
WORD="https"
19

    
20
# Set our operating platform
21
PLATFORM=`cat /etc/platform`
22

    
23
# endless loop
24
while : ; do
25

    
26
/etc/rc.banner
27

    
28
echo
29

    
30
# display a cheap menu
31
echo
32
echo " pfSense console setup "
33
echo "***********************"
34
echo " 0)  Logout (SSH only)"
35
echo " 1)  Assign Interfaces"
36
echo " 2)  Set LAN IP address"
37
echo " 3)  Reset webGUI password"
38
echo " 4)  Reset to factory defaults"
39
echo " 5)  Reboot system"
40
echo " 6)  Halt system"
41
echo " 7)  Ping host"
42
echo " 8)  Shell"
43
echo " 9)  PFtop"
44
echo "10)  Traffic Logs"
45
if [ -f /var/db/pfi/capable_* ]; then
46
    if [ ! -L /cf/conf ]; then
47
	echo "98)  Move configuration file to removable device"
48
    fi
49
fi
50

    
51
if [ "$PLATFORM" = "cdrom" ]; then
52
    echo "99)  Install pfSense to a hard drive/memory drive, etc."
53
    echo
54
fi
55

    
56
echo
57
read -p "Enter an option: " opmode
58
echo
59

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

    
116
sleep 1
117

    
118
done
119

    
(34-34/61)