Logo Search packages:      
Sourcecode: ufw version File versions

def src::frontend::UFWFrontend::set_enabled (   self,
  enabled 
)

Toggles ENABLED state in of <config_dir>/ufw/ufw.conf

Definition at line 289 of file frontend.py.

00289                                   :
        '''Toggles ENABLED state in of <config_dir>/ufw/ufw.conf'''
        res = ""
        try:
            if enabled:
                if not self.backend._is_enabled():
                    self.backend.set_default(self.backend.files['conf'], \
                                             "ENABLED", "yes")
                self.backend.start_firewall()
                res = _("Firewall started and enabled on system startup")
            else:
                if self.backend._is_enabled():
                    self.backend.set_default(self.backend.files['conf'], \
                                             "ENABLED", "no")
                self.backend.stop_firewall()
                res = _("Firewall stopped and disabled on system startup")
        except UFWError, e:
            error(e.value)

        return res

    def set_default_policy(self, policy):


Generated by  Doxygen 1.6.0   Back to index