Project

General

Profile

Download (4.52 KB) Statistics
| Branch: | Tag: | Revision:
1
#!/usr/local/bin/php -f
2
<?php
3
/* $Id$ */
4
/*
5
	rc.bootup
6
	part of pfSense by Scott Ullrich
7
	originally based on m0n0wall (http://m0n0.ch/wall)
8

    
9
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
10
	All rights reserved.
11

    
12
	Redistribution and use in source and binary forms, with or without
13
	modification, are permitted provided that the following conditions are met:
14

    
15
	1. Redistributions of source code must retain the above copyright notice,
16
	   this list of conditions and the following disclaimer.
17

    
18
	2. Redistributions in binary form must reproduce the above copyright
19
	   notice, this list of conditions and the following disclaimer in the
20
	   documentation and/or other materials provided with the distribution.
21

    
22
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
23
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
24
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
26
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31
	POSSIBILITY OF SUCH DAMAGE.
32
*/
33

    
34
	require_once("globals.inc");
35

    
36
	/* let the other functions know we're booting */
37
	$g['booting'] = TRUE;
38
	touch("{$g['varrun_path']}/booting");
39

    
40
	/* parse the configuration and include all functions used below */
41
	require_once("config.inc");
42
	require_once("functions.inc");
43

    
44
	$lan_if = $config['interfaces']['lan']['if'];
45
	$wan_if = get_real_wan_interface();
46

    
47
	$do_assign = 0;
48
	/* we need to ignore the vlan interface checks) */
49
	if(stristr($lan_if,"vlan") == false or stristr($wan_if,"vlan") == false) {
50
		if(does_interface_exist($lan_if) == false) {
51
			echo "\n\n\nLAN {$lan_if} interface mismatch.";
52
			$do_assign = 1;
53
		}
54
		if($config['interfaces']['wan']['ipaddr'] <> "pppoe" && $config['interfaces']['wan']['ipaddr'] <> "pptp" && $do_assign == 0) {
55
			if(does_interface_exist($wan_if) == false) {
56
				echo "\n\n\nWAN {$wan_if} interface mismatch.";
57
				$do_assign = 1;
58
			}
59
		}
60
		if($do_assign == 1) {
61
			$noreboot = true;
62
			echo " -- Running interface assignment option.\n";
63
			set_networking_interfaces_ports();
64
		}
65
	}
66

    
67
	/* convert configuration, if necessary */
68
	convert_config();
69

    
70
	/* read in /etc/sysctl.conf and set values if needed */
71
	system_setup_sysctl();
72

    
73
	/* run any early shell commands specified in config.xml */
74
	system_do_shell_commands(1);
75

    
76
	/* save dmesg output to file */
77
	system_dmesg_save();
78

    
79
	/* set up our timezone */
80
	system_timezone_configure();
81

    
82
	/* set up our hostname */
83
	system_hostname_configure();
84

    
85
	/* make hosts file */
86
	system_hosts_generate();
87

    
88
	/* generate resolv.conf */
89
	system_resolvconf_generate();
90

    
91
	/* start pccardd */
92
	if (!in_array($g['platform'], $g['nopccard_platforms']))
93
		system_pccard_start();
94

    
95
	/* configure loopback interface */
96
	interfaces_loopback_configure();
97

    
98
	/* set up VLAN virtual interfaces */
99
	interfaces_vlan_configure();
100

    
101
	/* set up LAN interface */
102
	interfaces_lan_configure();
103

    
104
	/* set up WAN interface */
105
	interfaces_wan_configure();
106

    
107
	/* set up Optional interfaces */
108
	interfaces_optional_configure();
109

    
110
	/* start pflog */
111
	filter_pflog_start();
112

    
113
	/* setup altq + pf */
114
	filter_configure();
115

    
116
	/* start OpenVPN server & clients */
117
	ovpn_configure();
118

    
119
	/* set up static routes */
120
	system_routing_configure();
121

    
122
	/* enable routing */
123
	system_routing_enable();
124

    
125
	/* start syslogd */
126
	system_syslogd_start();
127

    
128
	/* start web server */
129
	system_webgui_start();
130

    
131
	/* configure console menu */
132
	system_console_configure();
133

    
134
	/* start dnsmasq service */
135
	services_dnsmasq_configure();
136

    
137
	/* start dyndns service */
138
	services_dyndns_configure();
139

    
140
	/* start DHCP service */
141
	services_dhcpd_configure();
142

    
143
	/* start SNMP service */
144
	services_snmpd_configure();
145

    
146
	/* start proxy ARP service */
147
	services_proxyarp_configure();
148

    
149
	/* start the NTP client */
150
	system_ntp_configure();
151

    
152
	/* start pptpd */
153
	vpn_pptpd_configure();
154

    
155
	/* start IPsec tunnels */
156
	vpn_ipsec_configure();
157

    
158
	/* start the captive portal */
159
	captiveportal_configure();
160

    
161
	/* execute the rc scripts of extensions */
162
	system_do_extensions();
163

    
164
	/* run any shell commands specified in config.xml */
165
	system_do_shell_commands();
166

    
167
	/* start ftp proxy helpers if they are enabled */
168
	system_start_ftp_helpers();
169

    
170
	/* done */
171
	unlink("{$g['varrun_path']}/booting");
172
	$g['booting'] = FALSE;
173

    
174
?>
(21-21/49)