Finish up ap mode setup w/ service restarts et al

This commit is contained in:
Shaba Abhiram
2015-02-03 11:05:01 -08:00
parent a38c7922a7
commit e14f739437
2 changed files with 44 additions and 3 deletions

View File

@@ -0,0 +1,20 @@
# Defaults for hostapd initscript
#
# See /usr/share/doc/hostapd/README.Debian for information about alternative
# methods of managing hostapd.
#
# Uncomment and set DAEMON_CONF to the absolute path of a hostapd configuration
# file and hostapd will be started during system boot. An example configuration
# file can be found at /usr/share/doc/hostapd/examples/hostapd.conf.gz
#
DAEMON_CONF="/etc/hostapd/hostapd.conf"
# Additional daemon options to be appended to hostapd command:-
# -d show more debug messages (-dd for even more)
# -K include key data in debug messages
# -t include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
#DAEMON_OPTS=""

View File

@@ -158,8 +158,6 @@ module.exports = function() {
function update_dhcpd(next_step) {
var context = config.access_point;
// We must enable this to turn on the access point
write_template_to_file(
"./assets/etc/dhcp/dhcpd.conf.template",
"/etc/dhcp/dhcpd.conf",
@@ -175,11 +173,34 @@ module.exports = function() {
},
// Enable hostapd.conf file
function update_hostapd(next_step) {
function update_hostapd_conf(next_step) {
write_template_to_file(
"./assets/etc/hostapd/hostapd.conf.template",
"/etc/hostapd/hostapd.conf",
context, next_step);
},
function update_hostapd_default(next_step) {
write_template_to_file(
"./assets/etc/hostapd/hostapd.template",
"/etc/hostapd/hostapd",
context, next_step);
},
function restart_dhcp_service(next_step) {
exec("service isc-dhcp-server restart", function(error, stdout, stderr) {
console.log(stdout);
if (!error) console.log("dhcp server restarted!");
next_step(error);
});
},
function restart_hostapd_service(next_step) {
exec("service hostapd restart", function(error, stdout, stderr) {
console.log(stdout);
if (!error) console.log("hostapd restarted!");
next_step(error);
});
}
], callback);