def initialize_samba(self, **kwargs): if 'listItem' in kwargs: self.set_value(kwargs['listItem']) options = {} if self.struct['samba']['settings']['samba_autostart']['value'] == '1': state = 1 if 'hidden' in self.struct['samba']['settings']['samba_username']: del self.struct['samba']['settings']['samba_username']['hidden'] if 'hidden' in self.struct['samba']['settings']['samba_password']: del self.struct['samba']['settings']['samba_password']['hidden'] if self.struct['samba']['settings']['samba_secure']['value'] == '1': val_secure = 'true' else: val_secure = 'false' if self.struct['samba']['settings']['samba_autoshare']['value'] == '1': val_autoshare = 'true' else: val_autoshare = 'false' options['SAMBA_WORKGROUP'] = self.struct['samba']['settings']['samba_workgroup']['value'] options['SAMBA_SECURE'] = val_secure options['SAMBA_AUTOSHARE'] = val_autoshare options['SAMBA_MINPROTOCOL'] = self.struct['samba']['settings']['samba_minprotocol']['value'] options['SAMBA_MAXPROTOCOL'] = self.struct['samba']['settings']['samba_maxprotocol']['value'] options['SAMBA_USERNAME'] = self.struct['samba']['settings']['samba_username']['value'] options['SAMBA_PASSWORD'] = self.struct['samba']['settings']['samba_password']['value'] else: state = 0 self.struct['samba']['settings']['samba_username']['hidden'] = True self.struct['samba']['settings']['samba_password']['hidden'] = True oe.set_service('samba', options, state)
def initialize_cron(self, **kwargs): if 'listItem' in kwargs: self.set_value(kwargs['listItem']) options = {} if self.struct['cron']['settings']['cron_autostart']['value'] == '1': state = 1 else: state = 0 oe.set_service('crond', options, state)
def initialize_obex(self, **kwargs): if 'listItem' in kwargs: self.set_value(kwargs['listItem']) options = {} if self.struct['bluez']['settings']['obex_enabled']['value'] == '1': state = 1 options['OBEXD_ROOT'] = self.struct['bluez']['settings']['obex_root']['value'] else: state = 0 oe.set_service('obexd', options, state)
def init_netfilter(self, **kwargs): if 'listItem' in kwargs: self.set_value(kwargs['listItem']) state = 1 options = {} if self.struct['advanced']['settings']['netfilter']['value'] == oe._(32396): options['RULES'] = "custom" elif self.struct['advanced']['settings']['netfilter']['value'] == oe._(32398): options['RULES'] = "home" elif self.struct['advanced']['settings']['netfilter']['value'] == oe._(32399): options['RULES'] = "public" else: state = 0 oe.set_service('iptables', options, state)
def initialize_bluetooth(self, **kwargs): if 'listItem' in kwargs: self.set_value(kwargs['listItem']) options = {} if self.struct['bluez']['settings']['enabled']['value'] == '1': state = 1 if 'hidden' in self.struct['bluez']['settings']['obex_enabled']: del self.struct['bluez']['settings']['obex_enabled']['hidden'] if 'hidden' in self.struct['bluez']['settings']['obex_root']: del self.struct['bluez']['settings']['obex_root']['hidden'] else: state = 0 self.struct['bluez']['settings']['obex_enabled']['hidden'] = True self.struct['bluez']['settings']['obex_root']['hidden'] = True oe.set_service('bluez', options, state)
def initialize_ssh(self, **kwargs): if 'listItem' in kwargs: self.set_value(kwargs['listItem']) options = {} if self.struct['ssh']['settings']['ssh_autostart']['value'] == '1': state = 1 if self.struct['ssh']['settings']['ssh_secure']['value'] == '1': val = 'true' options['SSH_ARGS'] = self.OPT_SSH_NOPASSWD else: val = 'false' options['SSH_ARGS'] = '""' options['SSHD_DISABLE_PW_AUTH'] = val else: state = 0 oe.set_service('sshd', options, state)