Merge branch '2-install-docker-service' into 'master'
Resolve "Install docker service" Closes #2 See merge request icaotix/linux-tools!17
This commit is contained in:
commit
a8cb19099c
11
lnxtools.sh
11
lnxtools.sh
@ -1,17 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
cd "$DIR" || exit
|
||||
FILE=./your_system_information.txt
|
||||
|
||||
if [ "$1" == "prepare" ]
|
||||
then
|
||||
if [ ! -f "$FILE" ]; then
|
||||
echo "Preparing your system for the first run"
|
||||
apt update -y && apt upgrade -y
|
||||
apt install python3.7 python3-pip -y
|
||||
apt-get update -y && apt-get upgrade -y
|
||||
apt-get install curl screenfetch python3.7 python3-pip -y
|
||||
pip3 install setuptools wheel regex
|
||||
cd $DIR
|
||||
pip3 install -r requirements.txt
|
||||
python3 main.py helloworld
|
||||
else
|
||||
cd $DIR
|
||||
python3 main.py "$@"
|
||||
fi
|
||||
|
@ -1,6 +1,13 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
class HelloWorld:
|
||||
"""docstring for SampleModule."""
|
||||
|
||||
def run(self):
|
||||
print("This shows that your installation is working correctly.")
|
||||
subprocess.call("screenfetch", shell=True)
|
||||
print("You can now start using the tool.")
|
||||
output = subprocess.check_output("cat /etc/*-release", shell=True).decode("UTF-8")
|
||||
with open("your_system_information.txt", "w") as file:
|
||||
file.write(output)
|
||||
|
@ -1,23 +1,22 @@
|
||||
import json
|
||||
import subprocess
|
||||
|
||||
|
||||
class ToolsInstaller:
|
||||
|
||||
def __init__(self):
|
||||
with open("modules/install/programs.json") as config_file:
|
||||
self.programs_json = json.load(config_file)
|
||||
|
||||
def basic_tools(self):
|
||||
"""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)
|
||||
|
||||
subprocess.run("apt-get install -y bleachbit nano xrdp htop bash-completion dialog powertop tree wget",
|
||||
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)
|
||||
subprocess.run("apt-get install -y smartmontools gsmartcontrol", shell=True)
|
||||
|
||||
def docker(self):
|
||||
"""Install the Docker service on the machine"""
|
||||
subprocess.run("curl -fsSL https://get.docker.com | bash", shell=True)
|
||||
subprocess.run("curl -L \"https://github.com/docker/compose/releases/download/"
|
||||
"1.25.4/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose"
|
||||
"&& chmod +x /usr/local/bin/docker-compose", shell=True)
|
||||
|
@ -1,16 +0,0 @@
|
||||
{
|
||||
"basic-tools": [
|
||||
"bleachbit",
|
||||
"nano",
|
||||
"xrdp",
|
||||
"htop",
|
||||
"bash-completion",
|
||||
"dialog",
|
||||
"powertop",
|
||||
"tree"
|
||||
],
|
||||
"hard-drive": [
|
||||
"smartmontools",
|
||||
"gsmartcontrol"
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue
Block a user