Author: locilka Date: Wed Nov 2 14:51:17 2011 New Revision: 66662 URL: http://svn.opensuse.org/viewcvs/yast?rev=66662&view=rev Log: - Unified starting, stopping and checking for firewall status (bnc#727445) - 2.21.25 Modified: trunk/yast2/VERSION trunk/yast2/library/network/src/SuSEFirewall.ycp trunk/yast2/package/yast2.changes Modified: trunk/yast2/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/VERSION?rev=66662&r1=66661&r2=66662&view=diff ============================================================================== --- trunk/yast2/VERSION (original) +++ trunk/yast2/VERSION Wed Nov 2 14:51:17 2011 @@ -1 +1 @@ -2.21.24 +2.21.25 Modified: trunk/yast2/library/network/src/SuSEFirewall.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/library/network/src/SuSEFirewall.ycp?rev=66662&r1=66661&r2=66662&view=diff ============================================================================== --- trunk/yast2/library/network/src/SuSEFirewall.ycp (original) +++ trunk/yast2/library/network/src/SuSEFirewall.ycp Wed Nov 2 14:51:17 2011 @@ -115,6 +115,9 @@ list <string> firewall_services = [ "SuSEfirewall2_init", "SuSEfirewall2_setup" ]; list <string> firewall_services_reverse = [ "SuSEfirewall2_setup", "SuSEfirewall2_init" ]; + /* script for starting and checking firewall status */ + string firewall_script = "/sbin/SuSEfirewall2"; + list <string> SuSEFirewall_variables = [ // zones and interfaces "FW_DEV_INT", "FW_DEV_DMZ", "FW_DEV_EXT", @@ -1234,8 +1237,8 @@ tmpdir_file = tmpdir_file + "/SuSEfirewall2_YaST_output"; string command = sformat( - "/sbin/SuSEfirewall2 start 2>'%1'; cat '%1'; rm -rf '%1'", - tmpdir_file + "%1 start 2>'%2'; cat '%2'; rm -rf '%2'", + firewall_script, tmpdir_file ); y2milestone ("Starting firewall..."); map cmd = (map) SCR::Execute (.target.bash_output, command); @@ -1268,8 +1271,8 @@ tmpdir_file = tmpdir_file + "/SuSEfirewall2_YaST_output"; string command = sformat( - "/sbin/SuSEfirewall2 stop 2>'%1'; cat '%1'; rm -rf '%1'", - tmpdir_file + "%1 stop 2>'%2'; cat '%2'; rm -rf '%2'", + firewall_script, tmpdir_file ); y2milestone ("Stopping firewall..."); map cmd = (map) SCR::Execute (.target.bash_output, command); @@ -1371,19 +1374,16 @@ if (! SuSEFirewallIsInstalled()) return false; - //if (Mode::normal() || Mode::commandline()) { - foreach (string service, firewall_services, { - if (Service::Status(service) == 0) { - started = true; - break; - } - }); - //} + if (Mode::testsuite()) return true; - if (started == true) { - y2milestone("Firewall services are started"); + y2milestone ("Checking firewall status..."); + string cmd = sformat ("%1 status 1>/dev/null", firewall_script); + integer cmd_ret = (integer) SCR::Execute (.target.bash, cmd); + if (cmd_ret == 0) { + y2milestone ("Firewall services are started"); + started = true; } else { - y2milestone("Firewall services are stopped"); + y2milestone ("Firewall services are stopped"); } return started; Modified: trunk/yast2/package/yast2.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/yast2/package/yast2.changes?rev=66662&r1=66661&r2=66662&view=diff ============================================================================== --- trunk/yast2/package/yast2.changes (original) +++ trunk/yast2/package/yast2.changes Wed Nov 2 14:51:17 2011 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Nov 2 14:49:31 CET 2011 - locilka@suse.cz + +- Unified starting, stopping and checking for firewall status + (bnc#727445) +- 2.21.25 + +------------------------------------------------------------------- Tue Oct 25 15:45:33 CEST 2011 - locilka@suse.cz - Added new function String::ReplaceWith that is a replacement for -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org