Fixes for archlinux
This commit is contained in:
parent
1700734c2a
commit
04ddeb761e
6 changed files with 55 additions and 11 deletions
|
|
@ -50,13 +50,44 @@ if linux_distro=='debian':
|
|||
print('Error, cannot install MariaDB...')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
print('Setting the password...')
|
||||
|
||||
elif linux_distro=='arch':
|
||||
|
||||
if subprocess.call("sudo pacman -S --noconfirm mariadb", shell=True) > 0:
|
||||
if subprocess.call("sudo pacman -S --noconfirm mariadb expect", shell=True) > 0:
|
||||
print('Error, cannot install MariaDB...')
|
||||
exit(1)
|
||||
|
||||
if subprocess.call("sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=/var/lib/mysql", shell=True) > 0:
|
||||
print('Error, cannot execute mariadb-install-db')
|
||||
sys.exit(1)
|
||||
|
||||
if subprocess.call("sudo systemctl restart mariadb", shell=True) > 0:
|
||||
print('Error, cannot start mariadb')
|
||||
sys.exit(1)
|
||||
|
||||
if subprocess.call("sudo MYSQL_PASS=%s ./modules/pastafari2/scripts/servers/databases/mariadb/mysql_secure.sh" % args.password, shell=True) > 0:
|
||||
|
||||
print('Error, cannot set the password')
|
||||
|
||||
sys.exit(1)
|
||||
|
||||
if args.ip:
|
||||
|
||||
print('Changing IP to listen...')
|
||||
|
||||
if subprocess.call("sudo sed -i 's/^\[server\]$/[server]\\n\\nbind-address = {}/g' /etc/my.cnf.d/server.cnf".format(args.ip), shell=True) > 0:
|
||||
print('Error, cannot install MariaDB...')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
else:
|
||||
print('Listen localhost by default...')
|
||||
|
||||
|
||||
if subprocess.call("sudo systemctl enable mariadb", shell=True) > 0:
|
||||
print('Error, cannot start mariadb')
|
||||
sys.exit(1)
|
||||
|
||||
elif linux_distro=='rocky' or linux_distro=='alma' or linux_distro=='fedora':
|
||||
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ sleep(1)
|
|||
|
||||
if linux_distro=='arch':
|
||||
|
||||
# if call("sudo pacman -S --noconfirm --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si", shell=True) > 0:
|
||||
|
||||
if call("sudo pacman -S --noconfirm git", shell=True) > 0:
|
||||
print('Error, cannot install git...')
|
||||
exit(1)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then
|
|||
|
||||
elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then
|
||||
|
||||
pacman -Syu sudo
|
||||
pacman -Syu --noconfirm sudo
|
||||
|
||||
sudo pacman -S --noconfirm python python-pip sudo augeas python-virtualenv
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ sudo /opt/certbot/bin/pip install certbot certbot
|
|||
|
||||
echo "0 0,12 * * * root /opt/certbot/bin/python -c 'import random; import time; time.sleep(random.random() * 3600)' && sudo certbot renew -q" | sudo tee -a /etc/crontab > /dev/null
|
||||
|
||||
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
|
||||
sudo ln -sf /opt/certbot/bin/certbot /usr/bin/certbot
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import pwd
|
|||
from subprocess import call
|
||||
from pathlib import Path
|
||||
from time import sleep
|
||||
import distro
|
||||
|
||||
parser = argparse.ArgumentParser(description='A script for install leviathan user')
|
||||
|
||||
|
|
@ -191,6 +192,16 @@ if check_url.match(args.url_stats):
|
|||
print('{"error": 0, "status": 0, "progress": 100, "no_progress":0, "message": "Tools installed..."}')
|
||||
|
||||
sleep(1)
|
||||
|
||||
linux_distro=distro.id()
|
||||
|
||||
# sudo su - %s -s /bin/bash -c 'mkdir -p %s'
|
||||
|
||||
if linux_distro=='arch':
|
||||
print('Add utilities for archlinux distro...')
|
||||
if call("sudo su - %s -s /bin/bash -c 'sudo pacman -S --noconfirm --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm --needed'" % args.user, shell=True) > 0:
|
||||
print('Error, cannot add utilities for archlinux')
|
||||
exit(1)
|
||||
|
||||
else:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue