Project

General

Profile

Download (3.02 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 -n "Would you like to tail the progress [n]? "
19
	read ANSWER
20
	if [ "$ANSWER" = "y" ]; then
21
		echo
22
		echo "Tailing developer bootstrap process."
23
		echo
24
		echo "Press CTRL-C to abort."
25
		echo
26
		echo "Note, this tailing process will exit once the operation is completed."
27
		echo
28
		tail -f /tmp/bootup_messages
29
	fi
30
fi
31

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

    
38
CONFIG="/cf/conf/config.xml"
39
WORD="https"
40

    
41
# 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
# Set our operating platform
47
PLATFORM=`cat /etc/platform`
48

    
49
# endless loop
50
while : ; do
51

    
52
if [ -f /tmp/ttybug ]; then
53
	rm /tmp/ttybug
54
	exit && exit && logout
55
fi
56

    
57
/etc/rc.banner
58

    
59
# display a cheap menu
60
echo
61
echo
62
echo " pfSense console setup "
63
echo "***********************"
64
echo " 0)  Logout (SSH only)"
65
echo " 1)  Assign Interfaces"
66
echo " 2)  Set LAN IP address"
67
echo " 3)  Reset webConfigurator password"
68
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
echo "10)  Filter Logs"
75
echo "11)  Restart webConfigurator"
76
for i in /var/db/pfi/capable_*; do
77
    if [ -f $i -a ! -L /cf/conf ]; then
78
	echo "98)  Move configuration file to removable device"
79
	break
80
    fi
81
done
82

    
83
if [ "$PLATFORM" = "cdrom" ]; then
84
    echo "99)  Install pfSense to a hard drive/memory drive, etc."
85
    echo
86
fi
87

    
88
echo
89
read -p "Enter an option: " opmode
90
echo
91

    
92
# see what the user has chosen
93
case ${opmode} in
94
0)
95
        exit && exit && logout
96
        ;;
97
1)
98
        /etc/rc.initial.setports
99
        ;;
100
2)
101
        /etc/rc.initial.setlanip
102
        ;;
103
3)
104
        /etc/rc.initial.password
105
        ;;
106
4)
107
        /etc/rc.initial.defaults
108
        ;;
109
5)
110
        /etc/rc.initial.reboot
111
        ;;
112
6)
113
        /etc/rc.initial.halt
114
        ;;
115
7)
116
        /etc/rc.initial.ping
117
        ;;
118
8)
119
        /bin/tcsh
120
        ;;
121
9)
122
        /usr/local/sbin/pftop
123
        ;;
124
10)
125
	/usr/sbin/tcpdump -n -e -ttt -i pflog0
126
	;;
127
11)
128
	/etc/rc.restart_webgui
129
	;;
130
12)
131
	/etc/rc.banner
132
	;;	
133
98)
134
	if [ ! -f /tmp/config_moved ]; then
135
		/etc/rc.initial.store_config_to_removable_device
136
	fi
137
	;;
138
99)
139
	if [ -e /dev/ukbd0 ]; then
140
	    env TERM=cons25 /scripts/lua_installer
141
	else 
142
            /scripts/lua_installer
143
	fi
144
	;;
145
100)
146
    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
esac
158

    
159
done
160

    
(38-38/71)