Project

General

Profile

Download (3.59 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/usr/local/bin/php -f
2
<?php
3
/*
4
	rc.bootup
5 e5cd29a0 Scott Ullrich
	part of pfSense by Scott Ullrich
6
	originally based on m0n0wall (http://m0n0.ch/wall)
7
8 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
9
	All rights reserved.
10 e5cd29a0 Scott Ullrich
11 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13 e5cd29a0 Scott Ullrich
14 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16 e5cd29a0 Scott Ullrich
17 5b237745 Scott Ullrich
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20 e5cd29a0 Scott Ullrich
21 5b237745 Scott Ullrich
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32
33
	require_once("globals.inc");
34
35
	/* let the other functions know we're booting */
36
	$g['booting'] = TRUE;
37
	touch("{$g['varrun_path']}/booting");
38
39
	/* parse the configuration and include all functions used below */
40
	require_once("config.inc");
41
	require_once("functions.inc");
42 e5cd29a0 Scott Ullrich
43 5b237745 Scott Ullrich
	/* convert configuration, if necessary */
44
	convert_config();
45 e5cd29a0 Scott Ullrich
46 5b237745 Scott Ullrich
	/* run any early shell commands specified in config.xml */
47
	system_do_shell_commands(1);
48 e5cd29a0 Scott Ullrich
49 5b237745 Scott Ullrich
	/* save dmesg output to file */
50
	system_dmesg_save();
51 e5cd29a0 Scott Ullrich
52 5b237745 Scott Ullrich
	/* set up our timezone */
53
	system_timezone_configure();
54 e5cd29a0 Scott Ullrich
55 5b237745 Scott Ullrich
	/* set up our hostname */
56
	system_hostname_configure();
57 e5cd29a0 Scott Ullrich
58 5b237745 Scott Ullrich
	/* make hosts file */
59
	system_hosts_generate();
60 e5cd29a0 Scott Ullrich
61 5b237745 Scott Ullrich
	/* generate resolv.conf */
62
	system_resolvconf_generate();
63 e5cd29a0 Scott Ullrich
64 5b237745 Scott Ullrich
	/* start pccardd */
65
	if (!in_array($g['platform'], $g['nopccard_platforms']))
66
		system_pccard_start();
67 e5cd29a0 Scott Ullrich
68 5b237745 Scott Ullrich
	/* configure loopback interface */
69
	interfaces_loopback_configure();
70 e5cd29a0 Scott Ullrich
71 5b237745 Scott Ullrich
	/* set up VLAN virtual interfaces */
72
	interfaces_vlan_configure();
73 e5cd29a0 Scott Ullrich
74 5b237745 Scott Ullrich
	/* set up LAN interface */
75
	interfaces_lan_configure();
76 e5cd29a0 Scott Ullrich
77 5b237745 Scott Ullrich
	/* set up WAN interface */
78
	interfaces_wan_configure();
79 e5cd29a0 Scott Ullrich
80 5b237745 Scott Ullrich
	/* set up Optional interfaces */
81
	interfaces_optional_configure();
82 e5cd29a0 Scott Ullrich
83 24d15c0c Scott Ullrich
	/* start pflog */
84
	filter_pflog_start();
85 e5cd29a0 Scott Ullrich
86 24d15c0c Scott Ullrich
	/* setup altq + pf */
87
	filter_configure();
88 e5cd29a0 Scott Ullrich
89 24d15c0c Scott Ullrich
	/* start OpenVPN server & clients */
90
	ovpn_configure();
91 e5cd29a0 Scott Ullrich
92 5b237745 Scott Ullrich
	/* set up static routes */
93
	system_routing_configure();
94 e5cd29a0 Scott Ullrich
95 5b237745 Scott Ullrich
	/* enable routing */
96
	system_routing_enable();
97 e5cd29a0 Scott Ullrich
98 5b237745 Scott Ullrich
	/* start syslogd */
99
	system_syslogd_start();
100 e5cd29a0 Scott Ullrich
101 5b237745 Scott Ullrich
	/* start web server */
102
	system_webgui_start();
103 e5cd29a0 Scott Ullrich
104 5b237745 Scott Ullrich
	/* configure console menu */
105
	system_console_configure();
106 e5cd29a0 Scott Ullrich
107 5b237745 Scott Ullrich
	/* start dnsmasq service */
108
	services_dnsmasq_configure();
109 e5cd29a0 Scott Ullrich
110 5b237745 Scott Ullrich
	/* start dyndns service */
111
	services_dyndns_configure();
112 e5cd29a0 Scott Ullrich
113 5b237745 Scott Ullrich
	/* start DHCP service */
114
	services_dhcpd_configure();
115 e5cd29a0 Scott Ullrich
116 5b237745 Scott Ullrich
	/* start SNMP service */
117
	services_snmpd_configure();
118 e5cd29a0 Scott Ullrich
119 5b237745 Scott Ullrich
	/* start proxy ARP service */
120
	services_proxyarp_configure();
121
122
	/* start the NTP client */
123
	system_ntp_configure();
124 e5cd29a0 Scott Ullrich
125 5b237745 Scott Ullrich
	/* start pptpd */
126
	vpn_pptpd_configure();
127 e5cd29a0 Scott Ullrich
128 5b237745 Scott Ullrich
	/* start IPsec tunnels */
129
	vpn_ipsec_configure();
130 e5cd29a0 Scott Ullrich
131 5b237745 Scott Ullrich
	/* start the captive portal */
132
	captiveportal_configure();
133 e5cd29a0 Scott Ullrich
134 5b237745 Scott Ullrich
	/* execute the rc scripts of extensions */
135
	system_do_extensions();
136 e5cd29a0 Scott Ullrich
137 5b237745 Scott Ullrich
	/* run any shell commands specified in config.xml */
138
	system_do_shell_commands();
139 e5cd29a0 Scott Ullrich
140 5b237745 Scott Ullrich
	/* done */
141
	unlink("{$g['varrun_path']}/booting");
142
?>