3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-02 17:38:45 +02:00

auto-t: add copy_to_ap utility

This commit is contained in:
James Prestwood 2020-11-04 08:48:08 -08:00 committed by Denis Kenzior
parent a472874890
commit efe53e28c8

View File

@ -1036,6 +1036,7 @@ class IWD(AsyncOpAbstract):
def clear_storage(storage_dir=IWD_STORAGE_DIR):
os.system('rm -rf ' + storage_dir + '/*')
os.system('rm -rf ' + storage_dir + '/hotspot/*')
os.system('rm -rf ' + storage_dir + '/ap/*')
@staticmethod
def create_in_storage(file_name, file_content):
@ -1063,6 +1064,13 @@ class IWD(AsyncOpAbstract):
shutil.copy(source, IWD_STORAGE_DIR + "/hotspot")
@staticmethod
def copy_to_ap(source):
if not os.path.exists(IWD_STORAGE_DIR + "/ap"):
os.mkdir(IWD_STORAGE_DIR + "/ap")
IWD.copy_to_storage(source, IWD_STORAGE_DIR + '/ap/')
@staticmethod
def remove_from_storage(file_name):
os.system('rm -rf ' + IWD_STORAGE_DIR + '/\'' + file_name + '\'')