Project

General

Profile

Download (3.02 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/bin/sh
2
3 1b8df11b Bill Marquette
# $Id$
4 5b237745 Scott Ullrich
# /etc/rc.initial
5 99227fad Scott Ullrich
# part of pfSense by Scott Ullrich
6 e5cd29a0 Scott Ullrich
# Copyright (C) 2004 Scott Ullrich, All rights reserved.
7
# originally based on m0n0wall (http://neon1.net/m0n0wall)
8 5b237745 Scott Ullrich
# Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
9
# All rights reserved.
10 89c5f759 Scott Ullrich
11 d223f533 Scott Ullrich
if [ -e /usr/local/etc/rc.d/dev_bootstrap.sh ]; then
12
	echo
13 f6db5a83 Scott Ullrich
	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 d223f533 Scott Ullrich
	echo -n "Would you like to tail the progress [n]? "
19
	read ANSWER
20
	if [ "$ANSWER" = "y" ]; then
21 74283bbb Scott Ullrich
		echo
22
		echo "Tailing developer bootstrap process."
23 d223f533 Scott Ullrich
		echo
24
		echo "Press CTRL-C to abort."
25
		echo
26 74283bbb Scott Ullrich
		echo "Note, this tailing process will exit once the operation is completed."
27
		echo
28 d223f533 Scott Ullrich
		tail -f /tmp/bootup_messages
29
	fi
30
fi
31
32 cd80a0a8 Scott Ullrich
# make sure the user can't kill us by pressing Ctrl-C,
33
# ctrl-z, etc.
34 c1b3f102 Scott Ullrich
trap : 2
35
trap : 3
36
trap : 4
37 5b237745 Scott Ullrich
38 89c5f759 Scott Ullrich
CONFIG="/cf/conf/config.xml"
39
WORD="https"
40
41 b99acdb9 Scott Ullrich
# Document which terminal launched last
42
# so we can attempt to track down the
43
# rc.initial respawn issues.
44
echo `tty` > /tmp/last_term_seen
45
46 c0c27851 Scott Ullrich
# Set our operating platform
47
PLATFORM=`cat /etc/platform`
48
49 5b237745 Scott Ullrich
# endless loop
50
while : ; do
51
52 7c961207 Scott Ullrich
if [ -f /tmp/ttybug ]; then
53
	rm /tmp/ttybug
54
	exit && exit && logout
55
fi
56
57 6a997de8 Scott Ullrich
/etc/rc.banner
58
59 5b237745 Scott Ullrich
# display a cheap menu
60 085127d2 Scott Ullrich
echo
61 223d7e54 Scott Ullrich
echo
62 8a45d75b Scott Ullrich
echo " pfSense console setup "
63
echo "***********************"
64 e1a8dc99 Colin Smith
echo " 0)  Logout (SSH only)"
65
echo " 1)  Assign Interfaces"
66
echo " 2)  Set LAN IP address"
67 029b7cf7 Scott Ullrich
echo " 3)  Reset webConfigurator password"
68 bfcb39c4 Scott Ullrich
echo " 4)  Reset to factory defaults"
69
echo " 5)  Reboot system"
70
echo " 6)  Halt system"
71
echo " 7)  Ping host"
72
echo " 8)  Shell"
73
echo " 9)  PFtop"
74 ef5ebb35 Scott Ullrich
echo "10)  Filter Logs"
75 bb8deb4a Scott Ullrich
echo "11)  Restart webConfigurator"
76 f321b3a2 Scott Ullrich
for i in /var/db/pfi/capable_*; do
77
    if [ -f $i -a ! -L /cf/conf ]; then
78 4d28b3ec Scott Ullrich
	echo "98)  Move configuration file to removable device"
79 f321b3a2 Scott Ullrich
	break
80 4d28b3ec Scott Ullrich
    fi
81 f321b3a2 Scott Ullrich
done
82 2730fde3 Scott Ullrich
83
if [ "$PLATFORM" = "cdrom" ]; then
84 f446f817 Scott Ullrich
    echo "99)  Install pfSense to a hard drive/memory drive, etc."
85 2730fde3 Scott Ullrich
    echo
86
fi
87 5b237745 Scott Ullrich
88 75c72ffb Scott Ullrich
echo
89 568af189 Colin Smith
read -p "Enter an option: " opmode
90 4df08112 Scott Ullrich
echo
91 5b237745 Scott Ullrich
92
# see what the user has chosen
93
case ${opmode} in
94 debddb24 Scott Ullrich
0)
95 c900e2dc Scott Ullrich
        exit && exit && logout
96
        ;;
97 5b237745 Scott Ullrich
1)
98 c900e2dc Scott Ullrich
        /etc/rc.initial.setports
99
        ;;
100 5b237745 Scott Ullrich
2)
101 c900e2dc Scott Ullrich
        /etc/rc.initial.setlanip
102
        ;;
103 5b237745 Scott Ullrich
3)
104 c900e2dc Scott Ullrich
        /etc/rc.initial.password
105
        ;;
106 5b237745 Scott Ullrich
4)
107 c900e2dc Scott Ullrich
        /etc/rc.initial.defaults
108
        ;;
109 5b237745 Scott Ullrich
5)
110 c900e2dc Scott Ullrich
        /etc/rc.initial.reboot
111
        ;;
112 5b237745 Scott Ullrich
6)
113 c900e2dc Scott Ullrich
        /etc/rc.initial.halt
114
        ;;
115 5b237745 Scott Ullrich
7)
116 c900e2dc Scott Ullrich
        /etc/rc.initial.ping
117
        ;;
118 97a741af Scott Ullrich
8)
119 9607c2a4 Scott Ullrich
        /bin/tcsh
120 c900e2dc Scott Ullrich
        ;;
121 97a741af Scott Ullrich
9)
122 c900e2dc Scott Ullrich
        /usr/local/sbin/pftop
123
        ;;
124 97a741af Scott Ullrich
10)
125 9228eaab Scott Ullrich
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
126
	;;
127 8b52f644 Scott Ullrich
11)
128
	/etc/rc.restart_webgui
129
	;;
130 dc7e008c Scott Ullrich
12)
131
	/etc/rc.banner
132
	;;	
133 9eb7a7b4 Scott Ullrich
98)
134 2c69c9f7 Scott Ullrich
	if [ ! -f /tmp/config_moved ]; then
135 0b6c7bce Scott Ullrich
		/etc/rc.initial.store_config_to_removable_device
136
	fi
137 6e1fe0fc Scott Ullrich
	;;
138 c26023b4 Scott Ullrich
99)
139
	if [ -e /dev/ukbd0 ]; then
140
	    env TERM=cons25 /scripts/lua_installer
141
	else 
142
            /scripts/lua_installer
143
	fi
144 0b6163bd Scott Ullrich
	;;
145 f446f817 Scott Ullrich
100)
146 d8d46c26 Scott Ullrich
    if grep "$WORD" "$CONFIG"
147
    then
148
    	links "https://localhost"
149
    else
150
    	links "http://localhost"
151
    fi
152
    ;;
153
"")
154
	echo -n "Press CTRL-C to continue."
155
	sleep 1000000
156
	;;
157 5b237745 Scott Ullrich
esac
158
159 4c7856cf Scott Ullrich
done