Esempio n. 1
0
    def _install_packages(self):
        cur_packs = [
            curpack.split()[1]
            for curpack in os.popen('dpkg -l').read().split('\n')
            if len(curpack.split()) > 1
        ]

        to_install = [
            pack for pack in st.required_packages if pack not in cur_packs
        ]
        os.system(st.gen_pack_install(st.package_manager,
                                      ' '.join(to_install)))
Esempio n. 2
0
    def _install_arptables(self, network_managers='all', remove=False):
        def uninstall():
            os.system(st.gen_pack_remove(st.package_manager, 'arptables'))
        if remove:
            return uninstall()

        # check arptables installation
        if not (os.path.isfile('/usr/bin/arptables') or os.path.isfile('/usr/sbin/arptables')):
            if os.system(st.gen_pack_install(st.package_manager, 'arptables')):
                print('Invalid package manager. Unable to proceed. ')
        else:
            avalon.error('arptables not installed. Unable to proceed. Aborting...')
            uninstall()
Esempio n. 3
0
 def _install_tigher(self):
     if not os.path.isfile("/usr/sbin/tiger"):
         os.system(st.gen_pack_install(st.package_manager, "tiger"))
Esempio n. 4
0
 def _install_ufw(self):
     if not os.path.isfile("/usr/sbin/ufw"):
         os.system(st.gen_pack_install(st.package_manager, "ufw"))