bkruse: branch 1.4 r1727 - /branches/1.4/scripts/editzap.sh

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Wed Oct 24 16:06:17 CDT 2007


Author: bkruse
Date: Wed Oct 24 16:06:17 2007
New Revision: 1727

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1727
Log:
changing so that editzap will now PRESERVE the settings
the gui writes for zapscan! I need to document this better.

Modified:
    branches/1.4/scripts/editzap.sh

Modified: branches/1.4/scripts/editzap.sh
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/scripts/editzap.sh?view=diff&rev=1727&r1=1726&r2=1727
==============================================================================
--- branches/1.4/scripts/editzap.sh (original)
+++ branches/1.4/scripts/editzap.sh Wed Oct 24 16:06:17 2007
@@ -7,12 +7,11 @@
 # Quick script for applying zaptel settings from the GUI.
 
 ZAPCONF="/etc/zaptel.conf"
+ZAPATACONF="/etc/asterisk/zapata.conf"
 ZTCFG_OUTPUT="/var/lib/asterisk/static-http/config/ztcfg_output.html"
-
-# Note: Changing modules requires sed
-if [ $(which sed) == "" ] ; then
-	error_out("Sed not installed, needed to reload modules, you can do it manually by forcing the modules in via t1e1override")
-fi
+FILENAME="/etc/asterisk/applyzap.conf"
+MISDNCONF="/etc/misdn-init.conf"
+MISDNFILE="/etc/asterisk/applymisdn.conf"
 
 case ${1} in
 	changemodes)
@@ -28,16 +27,23 @@
 				$(modprobe zaptel; modprobe zttranscode; modprobe wct4xxp t1e1override=1; modprobe wcte11xp t1e1override=1; modprobe wct1xxp t1e1override=1; ztcfg)
 			;;
 			*)
-				error_out("No mode to change specified!")
+				error_out "No mode to change specified"
 			;;
 		esac	
 		;;
 	applysettings)	
 		# Split based on ||| delimeter, and apply to zaptel.
-		blob=`echo ${2} | sed 's/|||/\n/g'`
-		mv ${ZAPCONF} ${ZAPCONF}.b4editzap
-		cmd=`zapscan`
-		echo "${blob}" >> /etc/zaptel.conf
+		if [ "${2}" == "misdn" ]
+		then
+			grep -v "\[general\]" ${MISDNFILE} | grep -v "\;" > ${MISDNCONF}
+		else
+			grep -v "\[general\]" ${FILENAME} | grep -v "\;" > ${ZAPCONF} 
+			cp -rf ${ZAPCONF} ${ZAPCONF}.zapscan # save the gui settings!
+			cp -rf ${ZAPATACONF} ${ZAPATACONF}.zapscan # save the user settings
+			zapscan
+		fi
+		;;
+	ztcfg)
 		ztcfg -vv 2> $ZTCFG_OUTPUT
 		;;
 esac




More information about the asterisk-gui-commits mailing list