Project

General

Profile

Download (2.95 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
if [ -f /var/db/pfi/capable_* ]; then
77
    if [ ! -L /cf/conf ]; then
78
	echo "98)  Move configuration file to removable device"
79
    fi
80
fi
81

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

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

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

    
151
done
152

    
(38-38/71)