#!/bin/bash # # /etc/rc.d/rc.local: Local system initialization script. # # This fixes the stripper perl bug about locale settings export LC_ALL="C" # Starting CARDMGR Daemon if it is not already started CARDMGRServerRunning=`ps -ealf | grep '/sbin/cardmgr$'` if [ -z "$CARDMGRServerRunning" ] then echo "Starting CARDMGR Server:" /etc/rc.d/rc.pcmcia start sleep 1 else echo "CARDMGR Server is already running!" fi # Starting SSH Server if it is not already started SSHServerRunning=`ps -ealf | grep '/usr/sbin/sshd$'` if [ -z "$SSHServerRunning" ] then echo "Starting SSH Server:" /etc/rc.d/rc.sshd start else echo "SSH Server is already running!" fi # Pre-configuring wlan0 /etc/rc.d/rc.wlan0-pre # Starting NTP Daemon if it is not already started NTPServerRunning=`ps -ealf | grep '/usr/sbin/ntpd$'` if [ -z "$NTPServerRunning" ] then echo "Starting NTP Server:" /etc/rc.d/rc.ntpd start sleep 1 else echo "NTP Server is already running!" fi sleep 1 # Starting DHCP Server if it is not already started DHCPServerRunning=`ps -ealf | grep '/usr/sbin/dhcpd' | grep wlan0$` if [ -z "$DHCPServerRunning" ] then echo "Starting DHCP Server:" /etc/rc.d/rc.dhcpd start sleep 1 else echo "DHCP Server on wlan0 is already running!" fi sleep 1 # Starting BIND if it is not started yet and restarting BIND if it is BINDRunning=`ps -ealf | grep '/usr/sbin/named$'` if [ -z "$BINDRunning" ] then /etc/rc.d/rc.bind start sleep 1 else /etc/rc.d/rc.bind restart fi # Configuring wlan0 /etc/rc.d/rc.wlan0 # Starting NoCatAuth Captive Portal /usr/local/nocat/bin/gateway # Re-starting BIND /etc/rc.d/rc.bind restart