#!/usr/bin/perl
#------------------------------------------------------------
#This action starts the Samba LDAP service on the loopback 
#network for the bootstrap-console-save and post-install
#
#
#Copyright 2016 Koozali Foundation, Inc.
#08/16/2016: G.Zartman <gzartman@koozali.org>
#
#The code contained herein can be distributed under the same
#license as Perl
#
#TO DO:
#
#------------------------------------------------------------
package esmith::thisaction;

use strict;
use warnings;

##Pull arguments
my $event = $ARGV [0];

##Start loopback network
system ("/sbin/ifup lo");
die "Unable to start loopback network." if ($? == -1);

##Start Samba LDAP
my $start_samba = "/usr/sbin/samba --configfile=/etc/samba/smb_stage1.conf -D";
system ($start_samba);
die "Unable to start Stage 1 Samba." if ($? == -1);

1;

