Project

General

Profile

Download (3.3 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
if [ -e /usr/local/etc/rc.d/dev_bootstrap.sh ]; then
12
	echo
13
	echo "A developer bootstrap is most likely in progress."
14
	echo "This operation bootstraps all developer files from"
15
	echo "pfSense.com and also FreeBSD.org and builds a ISO"
16
	echo "to verify the environment is sane."
17
	echo
18
	echo "During this process, /usr/src is automatically downloaded"
19
	echo "and many supporting files are built, installed, etc."
20
	echo
21
	echo -n "Would you like to tail the progress (y/n) [n]? "
22
	read ANSWER
23
	if [ "$ANSWER" = "y" ]; then
24
		echo
25
		echo "Tailing developer bootstrap process."
26
		echo
27
		echo "Press CTRL-C to abort."
28
		echo
29
		echo "Note, this tailing process will exit once the operation is completed."
30
		echo
31
		tail -f /tmp/bootup_messages
32
	fi
33
fi
34

    
35
# make sure the user can't kill us by pressing Ctrl-C,
36
# ctrl-z, etc.
37
#trap : 2
38
#trap : 3
39
#trap : 4
40

    
41
CONFIG="/cf/conf/config.xml"
42
WORD="https"
43

    
44
# Document which terminal launched last
45
# so we can attempt to track down the
46
# rc.initial respawn issues.
47
echo `tty` > /tmp/last_term_seen
48

    
49
# Set our operating platform
50
PLATFORM=`cat /etc/platform`
51

    
52
# endless loop
53
while : ; do
54

    
55
if [ -f /tmp/ttybug ]; then
56
	rm /tmp/ttybug
57
	exit && exit && logout
58
fi
59

    
60
/etc/rc.banner
61

    
62
# display a cheap menu
63
echo
64
echo
65
echo " pfSense console setup "
66
echo "***********************"
67
echo " 0)  Logout (SSH only)"
68
echo " 1)  Assign Interfaces"
69
echo " 2)  Set LAN IP address"
70
echo " 3)  Reset webConfigurator password"
71
echo " 4)  Reset to factory defaults"
72
echo " 5)  Reboot system"
73
echo " 6)  Halt system"
74
echo " 7)  Ping host"
75
echo " 8)  Shell"
76
echo " 9)  PFtop"
77
echo "10)  Filter Logs"
78
echo "11)  Restart webConfigurator"
79
echo "12)  pfSense PHP shell"
80
echo "13)  Upgrade from console"
81
for i in /var/db/pfi/capable_*; do
82
    if [ -f $i -a ! -L /cf/conf ]; then
83
	echo "98)  Move configuration file to removable device"
84
	break
85
    fi
86
done
87

    
88
if [ "$PLATFORM" = "cdrom" ]; then
89
    echo "99)  Install pfSense to a hard drive/memory drive, etc."
90
    echo
91
fi
92

    
93
echo
94
read -p "Enter an option: " opmode
95
echo
96

    
97
# see what the user has chosen
98
case ${opmode} in
99
0)
100
        exit && exit && logout
101
        ;;
102
1)
103
        /etc/rc.initial.setports
104
        ;;
105
2)
106
        /etc/rc.initial.setlanip
107
        ;;
108
3)
109
        /etc/rc.initial.password
110
        ;;
111
4)
112
        /etc/rc.initial.defaults
113
        ;;
114
5)
115
        /etc/rc.initial.reboot
116
        ;;
117
6)
118
        /etc/rc.initial.halt
119
        ;;
120
7)
121
        /etc/rc.initial.ping
122
        ;;
123
8)
124
        /bin/tcsh
125
        ;;
126
9)
127
        /usr/local/sbin/pftop
128
        ;;
129
10)
130
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
131
	;;
132
11)
133
	/etc/rc.restart_webgui
134
	;;
135
12)
136
	/usr/local/sbin/pfSsh.php
137
	;;
138
13) 
139
	php -f /etc/rc.initial_firmware_update
140
	;;
141
14)
142
	/etc/rc.banner
143
	;;
144
98)
145
	if [ ! -f /tmp/config_moved ]; then
146
		/etc/rc.initial.store_config_to_removable_device
147
	fi
148
	;;
149
99)
150
	if [ -e /dev/ukbd0 ]; then
151
	    env TERM=cons25 /scripts/lua_installer
152
	else
153
            /scripts/lua_installer
154
	fi
155
	;;
156
100)
157
    if grep "$WORD" "$CONFIG"
158
    then
159
    	links "https://localhost"
160
    else
161
    	links "http://localhost"
162
    fi
163
    ;;
164
"")
165
	echo -n "Press CTRL-C to continue."
166
	sleep 1000000
167
	;;
168
esac
169

    
170
done
171

    
(40-40/77)