Use file exists to check wether install is needed
run screenfetch in helloworld module
This commit is contained in:
parent
b55318da26
commit
657b864202
@ -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-get update -y && apt-get upgrade -y
|
||||
apt-get install python3.7 python3-pip -y
|
||||
apt-get install curl screenfetch python3.7 python3-pip -y
|
||||
pip3 install setuptools wheel regex
|
||||
cd "$DIR" || exit
|
||||
pip3 install -r requirements.txt
|
||||
python3 main.py helloworld
|
||||
else
|
||||
cd "$DIR" || exit
|
||||
python3 main.py "$@"
|
||||
fi
|
||||
|
@ -6,8 +6,8 @@ class HelloWorld:
|
||||
|
||||
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")
|
||||
print("Your system information \n" + output)
|
||||
with open("your_system_information.txt", "w") as file:
|
||||
file.write(output)
|
||||
|
Loading…
Reference in New Issue
Block a user