Project

General

Profile

Download (2.22 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
# display a cheap menu
29
echo
30
echo
31
echo " pfSense console setup "
32
echo "***********************"
33
echo " 0)  Logout (SSH only)"
34
echo " 1)  Assign Interfaces"
35
echo " 2)  Set LAN IP address"
36
echo " 3)  Reset webGUI password"
37
echo " 4)  Reset to factory defaults"
38
echo " 5)  Reboot system"
39
echo " 6)  Halt system"
40
echo " 7)  Ping host"
41
echo " 8)  Shell"
42
echo " 9)  PFtop"
43
echo "10)  Traffic Logs"
44
echo "11)  Restart webConfigurator"
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
	/usr/sbin/vidcontrol -S on 2>/dev/null
88
	/usr/sbin/vidcontrol -s 1 2>/dev/null
89
	set prompt="%n\@%m\:%~# "
90
        /bin/tcsh
91
        ;;
92
9)
93
        /usr/local/sbin/pftop
94
        ;;
95
10)
96
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
97
	;;
98
11)
99
	/etc/rc.restart_webgui
100
	;;
101
98)
102
	/etc/rc.initial.store_config_to_removable_device
103
	;;
104
99)
105
	if [ -e /dev/ukbd0 ]; then
106
	    env TERM=cons25 /scripts/lua_installer
107
	else 
108
            /scripts/lua_installer
109
	fi
110
	;;
111
100)
112
        if grep "$WORD" "$CONFIG"
113
        then
114
        	links "https://localhost"
115
        else
116
        	links "http://localhost"
117
        fi
118
        ;;
119
esac
120

    
121
sleep 1
122

    
123
done
124

    
(38-38/71)