qwell: branch aadk r779 - /branches/aadk/scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Apr 26 13:42:13 MST 2007


Author: qwell
Date: Thu Apr 26 15:42:12 2007
New Revision: 779

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=779
Log:
set text file properties, fix line endings on networking.sh

Modified:
    branches/aadk/scripts/graphs.sh   (props changed)
    branches/aadk/scripts/gui_sysinfo   (props changed)
    branches/aadk/scripts/listfiles   (props changed)
    branches/aadk/scripts/networking.sh   (contents, props changed)
    branches/aadk/scripts/output_path   (props changed)

Propchange: branches/aadk/scripts/graphs.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/aadk/scripts/graphs.sh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/aadk/scripts/graphs.sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: branches/aadk/scripts/gui_sysinfo
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/aadk/scripts/gui_sysinfo
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/aadk/scripts/gui_sysinfo
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/aadk/scripts/gui_sysinfo
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: branches/aadk/scripts/listfiles
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/aadk/scripts/listfiles
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/aadk/scripts/listfiles
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/aadk/scripts/listfiles
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: branches/aadk/scripts/networking.sh
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/scripts/networking.sh?view=diff&rev=779&r1=778&r2=779
==============================================================================
--- branches/aadk/scripts/networking.sh (original)
+++ branches/aadk/scripts/networking.sh Thu Apr 26 15:42:12 2007
@@ -1,26 +1,26 @@
-#!/bin/sh
+#!/bin/sh
 
 # Copyright (C) 2007, Digium, Inc.
 #
-# Brandon Kruse <bkruse at digium.com>
-#
-# Script to apply network settings from the GUI.
+# Brandon Kruse <bkruse at digium.com>
+#
+# Script to apply network settings from the GUI.
 
-WAN_INTERFACE="eth0"
-LAN_INTERFACE="eth1"
-DNS_CONFIG="/etc/config/resolv.conf"
-DHCP_CONFIG="/etc/udhcpd.conf"
-DHCP_BIN="`which udhcpd`"
-DHCP_SERVER="udhcpd"
-
+WAN_INTERFACE="eth0"
+LAN_INTERFACE="eth1"
+DNS_CONFIG="/etc/config/resolv.conf"
+DHCP_CONFIG="/etc/udhcpd.conf"
+DHCP_BIN="`which udhcpd`"
+DHCP_SERVER="udhcpd"
+
 ARG_FILE="/etc/asterisk/scripts/network.params"
 
-# We are going to set default values for the appliance 
-if [ -f ${ARG_FILE} ]; then
-	echo "Configuring with network.params"
-	. ${ARG_FILE} 	# Include the file that has the variables in it, written from the GUI.
+# We are going to set default values for the appliance 
+if [ -f ${ARG_FILE} ]; then
+	echo "Configuring with network.params"
+	. ${ARG_FILE} 	# Include the file that has the variables in it, written from the GUI.
 else
-	echo "Configuring interface for the first time, or after configuration loss."
+	echo "Configuring interface for the first time, or after configuration loss."
 	HOSTNAME=asteriskpbx
 	IP_LAN=192.168.69.1
 	SSHACCESS=no
@@ -32,88 +32,88 @@
 	END_RANGE_LAN=192.168.69.150
 	MAX_LEASE=100
 	DNS_LAN=${IP_LAN}
-fi
-
-ifconfig lo 127.0.0.1
-
-# Now for the real logic in the script.
+fi
+
+ifconfig lo 127.0.0.1
+
+# Now for the real logic in the script.
 # Note: You CANNOT use functions with msh/busybox.
-
-# Set our hostname
+
+# Set our hostname
 if [ "${HOSTNAME}" == "" ]; then
-	HOSTNAME=asteriskpbx
-fi
+	HOSTNAME=asteriskpbx
+fi
 hostname ${HOSTNAME}
-
-# Set our time server
-if [ "${NTP_LAN}" != "" ]; then
-	killall -9 ntpdate
-	ntpdate ${NTP_LAN} &
-fi
-
-# Turn on our ssh server
-if [ "${SSHACCESS}" = "yes" ]; then
-	inetd &
-fi
-
+
+# Set our time server
+if [ "${NTP_LAN}" != "" ]; then
+	killall -9 ntpdate
+	ntpdate ${NTP_LAN} &
+fi
+
+# Turn on our ssh server
+if [ "${SSHACCESS}" = "yes" ]; then
+	inetd &
+fi
+
 # Setup the WAN interface.
-if [ "${DHCP_WAN}" = "on" ]; then
-	# If dhcp_wan is set from the gui
+if [ "${DHCP_WAN}" = "on" ]; then
+	# If dhcp_wan is set from the gui
 	killall -9 dhcpcd
-	killall -9 dhcpcd.real
-	dhcpcd ${WAN_INTERFACE} & 
-else
-	echo "WAN interface is ${WAN_INTERFACE} WAN IP is ${IP_WAN} WAN subnet is ${SUBNET_WAN}"
-	echo "DNS config file is ${DNS_CONFIG}"
-	ifconfig ${WAN_INTERFACE} ${IP_WAN} netmask ${SUBNET_WAN}
-	echo "`cat ${DNS_CONFIG} | grep search`" > ${DNS_CONFIG}.tmp # Save the previous "search" field
-	mv ${DNS_CONFIG}.tmp ${DNS_CONFIG}
-	echo "nameserver ${DNS_WAN}" >> ${DNS_CONFIG} # Add the IP/hostname of the nameserver
-	route -n add ${GATEWAY_WAN} ${WAN_INTERFACE} # Add our default gateway for the WAN interface
-fi 
-
-# Setup the LAN interface(s).
-echo ${IP_LAN} ${HOSTNAME} > /etc/hosts
-ifconfig ${LAN_INTERFACE} ${IP_LAN} netmask ${SUBNET_LAN}
-route -n add ${GATEWAY_LAN} ${LAN_INTERFACE} # Add our default gateway for the LAN interface
+	killall -9 dhcpcd.real
+	dhcpcd ${WAN_INTERFACE} &
+else
+	echo "WAN interface is ${WAN_INTERFACE} WAN IP is ${IP_WAN} WAN subnet is ${SUBNET_WAN}"
+	echo "DNS config file is ${DNS_CONFIG}"
+	ifconfig ${WAN_INTERFACE} ${IP_WAN} netmask ${SUBNET_WAN}
+	echo "`cat ${DNS_CONFIG} | grep search`" > ${DNS_CONFIG}.tmp # Save the previous "search" field
+	mv ${DNS_CONFIG}.tmp ${DNS_CONFIG}
+	echo "nameserver ${DNS_WAN}" >> ${DNS_CONFIG} # Add the IP/hostname of the nameserver
+	route -n add ${GATEWAY_WAN} ${WAN_INTERFACE} # Add our default gateway for the WAN interface
+fi 
+
+# Setup the LAN interface(s).
+echo ${IP_LAN} ${HOSTNAME} > /etc/hosts
+ifconfig ${LAN_INTERFACE} ${IP_LAN} netmask ${SUBNET_LAN}
+route -n add ${GATEWAY_LAN} ${LAN_INTERFACE} # Add our default gateway for the LAN interface
 iptables -F
 dnsmasq &
-# XXX This will pretty much only work for a /24 XXX
-NETWORK_LAN=`echo "${IP_LAN}" | cut -d '.' -f 1,2,3`
-iptables -t nat -A POSTROUTING -s ${NETWORK_LAN}.0/${SUBNET_LAN} -d 0.0.0.0/0 -j MASQUERADE
-echo 1 > /proc/sys/net/ipv4/ip_forward
+# XXX This will pretty much only work for a /24 XXX
+NETWORK_LAN=`echo "${IP_LAN}" | cut -d '.' -f 1,2,3`
+iptables -t nat -A POSTROUTING -s ${NETWORK_LAN}.0/${SUBNET_LAN} -d 0.0.0.0/0 -j MASQUERADE
+echo 1 > /proc/sys/net/ipv4/ip_forward
 echo "LAN network is ${NETWORK_LAN}"
-if [ "${DHCP_LAN}" != "off" ]; then
-	# Now we will edit /etc/udhcpd.conf
-	echo "start ${START_RANGE_LAN}" > ${DHCP_CONFIG}
-	echo "end ${END_RANGE_LAN}" >> ${DHCP_CONFIG}
-	echo "interface ${LAN_INTERFACE}" >> ${DHCP_CONFIG}
-	echo "max_leases ${MAX_LEASE}" >> ${DHCP_CONFIG}
-	echo "remaining yes" >> ${DHCP_CONFIG}
-	echo "opt subnet ${SUBNET_LAN}" >> ${DHCP_CONFIG}
-	if [ "${DNS_LAN}" != "" ]; then
-		echo "opt dns ${DNS_LAN}" >> ${DHCP_CONFIG}
-	fi
-	if [ "${ROUTER_LAN}" != "" ]; then
-		echo "opt router ${ROUTER_LAN}" >> ${DHCP_CONFIG}
-	else
-		echo "opt router ${IP_LAN}" >> ${DHCP_CONFIG}
-	fi
-	if [ "${DOMAIN_LAN}" != "" ]; then
-		echo "opt domain ${DOMAIN_LAN}" >> ${DHCP_CONFIG}
-	fi
-	if [ "${LEASE_LAN}" != "" ]; then 
-		echo "opt lease ${LEASE_LAN}" >> ${DHCP_CONFIG}
-	else
-		echo "opt lease 8640000" >> ${DHCP_CONFIG}
-	fi
-	if [ "${TFTP_LAN}" != "" ]; then
-		echo "opt tftp ${TFTP_LAN}" >> ${DHCP_CONFIG}
-	fi
-	if [ "${NTP_LAN}" != "" ]; then
-		echo "opt ntpsrv ${NTP_LAN}" >> ${DHCP_CONFIG}
-	fi
-	# Stop and restart our dhcp server.
+if [ "${DHCP_LAN}" != "off" ]; then
+	# Now we will edit /etc/udhcpd.conf
+	echo "start ${START_RANGE_LAN}" > ${DHCP_CONFIG}
+	echo "end ${END_RANGE_LAN}" >> ${DHCP_CONFIG}
+	echo "interface ${LAN_INTERFACE}" >> ${DHCP_CONFIG}
+	echo "max_leases ${MAX_LEASE}" >> ${DHCP_CONFIG}
+	echo "remaining yes" >> ${DHCP_CONFIG}
+	echo "opt subnet ${SUBNET_LAN}" >> ${DHCP_CONFIG}
+	if [ "${DNS_LAN}" != "" ]; then
+		echo "opt dns ${DNS_LAN}" >> ${DHCP_CONFIG}
+	fi
+	if [ "${ROUTER_LAN}" != "" ]; then
+		echo "opt router ${ROUTER_LAN}" >> ${DHCP_CONFIG}
+	else
+		echo "opt router ${IP_LAN}" >> ${DHCP_CONFIG}
+	fi
+	if [ "${DOMAIN_LAN}" != "" ]; then
+		echo "opt domain ${DOMAIN_LAN}" >> ${DHCP_CONFIG}
+	fi
+	if [ "${LEASE_LAN}" != "" ]; then 
+		echo "opt lease ${LEASE_LAN}" >> ${DHCP_CONFIG}
+	else
+		echo "opt lease 8640000" >> ${DHCP_CONFIG}
+	fi
+	if [ "${TFTP_LAN}" != "" ]; then
+		echo "opt tftp ${TFTP_LAN}" >> ${DHCP_CONFIG}
+	fi
+	if [ "${NTP_LAN}" != "" ]; then
+		echo "opt ntpsrv ${NTP_LAN}" >> ${DHCP_CONFIG}
+	fi
+	# Stop and restart our dhcp server.
 	killall -9 ${DHCP_SERVER}
-	${DHCP_BIN} &
+	${DHCP_BIN} &
 fi

Propchange: branches/aadk/scripts/networking.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/aadk/scripts/networking.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/aadk/scripts/networking.sh
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/aadk/scripts/networking.sh
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: branches/aadk/scripts/output_path
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: branches/aadk/scripts/output_path
------------------------------------------------------------------------------
    svn:executable = *

Propchange: branches/aadk/scripts/output_path
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: branches/aadk/scripts/output_path
------------------------------------------------------------------------------
    svn:mime-type = text/plain



More information about the asterisk-gui-commits mailing list