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
|
#!/bin/bash
|
||||||
|
|
||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
cd "$DIR" || exit
|
||||||
|
FILE=./your_system_information.txt
|
||||||
|
|
||||||
if [ "$1" == "prepare" ]
|
if [ ! -f "$FILE" ]; then
|
||||||
then
|
|
||||||
echo "Preparing your system for the first run"
|
echo "Preparing your system for the first run"
|
||||||
apt update -y && apt upgrade -y
|
apt-get update -y && apt-get upgrade -y
|
||||||
apt install python3.7 python3-pip -y
|
apt-get install curl screenfetch python3.7 python3-pip -y
|
||||||
pip3 install setuptools wheel regex
|
pip3 install setuptools wheel regex
|
||||||
cd $DIR
|
|
||||||
pip3 install -r requirements.txt
|
pip3 install -r requirements.txt
|
||||||
python3 main.py helloworld
|
python3 main.py helloworld
|
||||||
else
|
else
|
||||||
cd $DIR
|
|
||||||
python3 main.py "$@"
|
python3 main.py "$@"
|
||||||
fi
|
fi
|
||||||
|
@ -1,6 +1,13 @@
|
|||||||
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class HelloWorld:
|
class HelloWorld:
|
||||||
"""docstring for SampleModule."""
|
"""docstring for SampleModule."""
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
print("This shows that your installation is working correctly.")
|
print("This shows that your installation is working correctly.")
|
||||||
|
subprocess.call("screenfetch", shell=True)
|
||||||
print("You can now start using the tool.")
|
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
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
class ToolsInstaller:
|
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):
|
def basic_tools(self):
|
||||||
"""Install the most basic tools!"""
|
"""Install the most basic tools!"""
|
||||||
print("Try to install basic Command-line tools")
|
print("Try to install basic Command-line tools")
|
||||||
|
subprocess.run("apt-get install -y bleachbit nano xrdp htop bash-completion dialog powertop tree wget",
|
||||||
programs_list = " ".join(p for p in self.programs_json['basic-tools'])
|
shell=True)
|
||||||
subprocess.run("apt install" + programs_list, shell=True)
|
|
||||||
|
|
||||||
print("Script ran to completion.")
|
print("Script ran to completion.")
|
||||||
|
|
||||||
def hard_drive_tools(self):
|
def hard_drive_tools(self):
|
||||||
"""Install tools to look up smart information from your hard-drives"""
|
"""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-get install -y smartmontools gsmartcontrol", shell=True)
|
||||||
subprocess.run("apt install " + programs_list, 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