2020-03-06 01:23:20 +01:00
|
|
|
import json
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
2020-03-06 02:34:57 +01:00
|
|
|
class ToolsInstaller:
|
2020-03-06 01:23:20 +01:00
|
|
|
|
|
|
|
def __init__(self):
|
2020-03-06 02:34:57 +01:00
|
|
|
with open("modules/install/programs.json") as config_file:
|
2020-03-06 01:23:20 +01:00
|
|
|
self.programs_json = json.load(config_file)
|
|
|
|
|
2020-03-06 02:34:57 +01:00
|
|
|
def basic_tools(self):
|
2020-03-06 01:23:20 +01:00
|
|
|
"""Install the most basic tools!"""
|
|
|
|
print("Try to install basic Command-line tools")
|
|
|
|
|
|
|
|
programs_list = " ".join(p for p in self.programs_json['basic-tools'])
|
|
|
|
subprocess.run("apt install" + programs_list, shell=True)
|
|
|
|
|
|
|
|
print("Script ran to completion.")
|
|
|
|
|
|
|
|
def hard_drive_tools(self):
|
|
|
|
"""Install tools to look up smart information from your hard-drives"""
|
|
|
|
programs_list = " ".join(p for p in self.programs_json['hard-drive'])
|
|
|
|
subprocess.run("apt install " + programs_list, shell=True)
|