Fixes in updates
This commit is contained in:
parent
25d98341ac
commit
7a3fe536a8
7 changed files with 94 additions and 9 deletions
24
scripts/system/install_git.py
Normal file
24
scripts/system/install_git.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/python3 -u
|
||||
|
||||
# A script for install pzoo user
|
||||
|
||||
from subprocess import call
|
||||
from time import sleep
|
||||
import distro
|
||||
|
||||
linux_distro=distro.id()
|
||||
|
||||
print('{"error": 0, "status": 0, "progress": 0, "no_progress":0, "message": "Installing git..."}')
|
||||
|
||||
sleep(1)
|
||||
|
||||
if linux_distro=='arch':
|
||||
|
||||
if call("sudo pacman -S --noconfirm git", shell=True) > 0:
|
||||
print('Error, cannot install git...')
|
||||
exit(1)
|
||||
elif linux_distro=='debian':
|
||||
|
||||
if call('sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y git', shell=True) > 0:
|
||||
print('Error, cannot install git...')
|
||||
exit(1)
|
||||
|
|
@ -6,10 +6,8 @@ sleep 1
|
|||
|
||||
echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Installing python3-psutil..."}'
|
||||
|
||||
sudo DEBIAN_FRONTEND="noninteractive" apt-get install -y python3-pip
|
||||
|
||||
#sudo pip3 install psutil
|
||||
sudo apt-get install -y python3-psutil
|
||||
sudo pip3 install psutil
|
||||
#sudo apt-get install -y python3-psutil
|
||||
|
||||
#echo "Installed python3-psutil sucessfully if not error..."
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
sleep 1
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ if [[ $DISTRO =~ ^Debian ]]; then
|
|||
|
||||
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
|
||||
|
||||
sudo pacman -S python python-pip
|
||||
sudo pacman -S --noconfirm python python-pip
|
||||
|
||||
else
|
||||
|
||||
|
|
@ -40,5 +40,26 @@ else
|
|||
|
||||
fi
|
||||
|
||||
echo '{"error": 0, "status": 0, "progress": 0, "no_progress":0, "message": "Installing distro package for python and detect distribution..."}'
|
||||
|
||||
sleep 1
|
||||
|
||||
sudo pip3 install distro
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
#echo "Installed python3 sucessfully if not error..."
|
||||
echo '{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Installed distro python package sucessfully..."}'
|
||||
|
||||
sleep 1
|
||||
|
||||
else
|
||||
|
||||
echo "Sorry, cannot install distro python package..."
|
||||
|
||||
exit 1;
|
||||
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
|
||||
|
|
|
|||
28
scripts/system/updates.py
Normal file
28
scripts/system/updates.py
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/python3 -u
|
||||
|
||||
# A script for install pzoo user
|
||||
|
||||
from subprocess import call
|
||||
from time import sleep
|
||||
import distro
|
||||
|
||||
linux_distro=distro.id()
|
||||
|
||||
print('{"error": 0, "status": 0, "progress": 0, "no_progress":0, "message": "Upgrading server..."}')
|
||||
|
||||
sleep(1)
|
||||
|
||||
if linux_distro=='arch':
|
||||
|
||||
if call("sudo pacman -Syu --noconfirm", shell=True) > 0:
|
||||
print('Error, cannot upgrade server...')
|
||||
exit(1)
|
||||
elif linux_distro=='debian':
|
||||
|
||||
if call('sudo DEBIAN_FRONTEND="noninteractive" apt-get -y update', shell=True) > 0:
|
||||
print('Error, cannot upgrade server...')
|
||||
exit(1)
|
||||
|
||||
if call('sudo DEBIAN_FRONTEND="noninteractive" apt-get -y upgrade', shell=True) > 0:
|
||||
print('Error, cannot upgrade server...')
|
||||
exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue