espiceland: branch 2.0 r5131 - /branches/2.0/config/js/hardware_dahdi.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Dec 7 13:58:22 CST 2010


Author: espiceland
Date: Tue Dec  7 13:58:20 2010
New Revision: 5131

URL: http://svnview.digium.com/svn/asterisk-gui?view=rev&rev=5131
Log:
Fix issue where previous options line was not deleted before adding new options line. This was not an issue back when we used to overwrite modprobe.conf/dahdi.conf every time. ASTGUI-316.

Modified:
    branches/2.0/config/js/hardware_dahdi.js

Modified: branches/2.0/config/js/hardware_dahdi.js
URL: http://svnview.digium.com/svn/asterisk-gui/branches/2.0/config/js/hardware_dahdi.js?view=diff&rev=5131&r1=5130&r2=5131
==============================================================================
--- branches/2.0/config/js/hardware_dahdi.js (original)
+++ branches/2.0/config/js/hardware_dahdi.js Tue Dec  7 13:58:20 2010
@@ -851,6 +851,7 @@
 		ASTGUI.dialog.waitWhile('updating modprobe configuration ...');
 		var cmd1 = "cp /etc/asterisk/modprobe_default /etc/modprobe.d/dahdi.conf";
 		var params = "options " + $('#zap_moduleName').val();
+		var params_to_delete = params;
 
 		if( $('#enable_disable_checkbox_opermode:checked').val() !== null ){
 			var h = $('#opermode').val();
@@ -906,7 +907,7 @@
 		h = ASTGUI.getFieldValue('vpmnlpmaxsupp');
 			if(h){ params += " vpmnlpmaxsupp=" + h; }
 	
-		var cmd2 = "echo \"" + params + "\" >> /etc/modprobe.d/dahdi.conf ";
+		var cmd2 = "grep -v \"^" + params_to_delete + "\" /etc/modprobe.d/dahdi.conf > /etc/modprobe.d/dahdi.conf ; echo \"" + params + "\" >> /etc/modprobe.d/dahdi.conf ";
 	
 		var update_usersConf = function(){
 			// update MWI settings in users.conf
@@ -937,11 +938,9 @@
 			return;
 		}
 
-		ASTGUI.systemCmd( cmd1, function(){ 
-			ASTGUI.systemCmd( cmd2, function(){ 
-				ASTGUI.dialog.waitWhile('updating Analog Trunks with MWI settings ...');
-				update_usersConf();
-			});
+		ASTGUI.systemCmd( cmd2, function(){ 
+			ASTGUI.dialog.waitWhile('updating Analog Trunks with MWI settings ...');
+			update_usersConf();
 		});
 		
 	},




More information about the asterisk-gui-commits mailing list