This commit is contained in:
askiiart 2023-09-06 20:50:11 -05:00
commit af69964db4
No known key found for this signature in database
GPG key ID: 85505F3A2264FA01
3 changed files with 47 additions and 19 deletions

View file

@ -9,9 +9,7 @@ EMAIL="dev@askiiart.net"
# Note: This waits until enter is pressed # Note: This waits until enter is pressed
# read -p "Press Enter to continue" < /dev/tty # read -p "Press Enter to continue" < /dev/tty
if [ $(whoami) != "root" ]; then if [ $(whoami) == "root" ]; then
SUDO="sudo"
else
echo "Run as a normal user, not root" echo "Run as a normal user, not root"
exit 1 exit 1
fi fi
@ -19,19 +17,19 @@ fi
command_exists() { type "$1" &>/dev/null; } command_exists() { type "$1" &>/dev/null; }
if command_exists "apt-get"; then if command_exists "apt-get"; then
$SUDO apt-get install pass git -y sudo apt-get install pass git -y
elif command_exists "yum"; then elif command_exists "yum"; then
$SUDO yum install pass git -y sudo yum install pass git -y
elif command_exists "pacman"; then elif command_exists "pacman"; then
$SUDO pacman -S git --noconfirm sudo pacman -S git --noconfirm
$SUDO pacman -S pass --noconfirm sudo pacman -S pass --noconfirm
elif command_exists "zypp"; then elif command_exists "zypp"; then
$SUDO zypper install pass git -y sudo zypper install pass git -y
elif command_exists "emerge"; then elif command_exists "emerge"; then
$SUDO echo Not yet supported, exiting... sudo echo Not yet supported, exiting...
elif command_exists "apk"; then elif command_exists "apk"; then
$SUDO apk add pass sudo apk add pass
$SUDO apk add git sudo apk add git
else else
echo "Unsupported: unknown package manager" echo "Unsupported: unknown package manager"
fi fi

30
qemu-install.sh Normal file
View file

@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
if [ $(whoami) == "root" ]; then
echo "Run as a normal user, not root"
exit 1
fi
command_exists() { type "$1" &>/dev/null; }
if command_exists "apt-get"; then
sudo apt-get install qemu-system libvirt-daemon-system virt-manager -y
elif command_exists "yum"; then
sudo yum install @Virtualization virt-manager -y
elif command_exists "pacman"; then
sudo pacman -S qemu-full --noconfirm
sudo pacman -S virt-manager --noconfirm
elif command_exists "zypp"; then
# Untested
sudo zypper install qemu -y
elif command_exists "emerge"; then
sudo echo Not yet supported, exiting...
elif command_exists "apk"; then
sudo apk add qemu-img qemu-system-x86_64 libvirt-daemon py-libvirt py-libxml2
sudo apk add git
sudo rc-update add libvirtd
sudo rc-service libvirtd start
else
echo "Unsupported: unknown package manager"
fi

View file

@ -12,19 +12,19 @@ fi
command_exists() { type "$1" &>/dev/null; } command_exists() { type "$1" &>/dev/null; }
if command_exists "apt-get"; then if command_exists "apt-get"; then
$SUDO apt-get install zsh -y sudo apt-get install zsh -y
elif command_exists "yum"; then elif command_exists "yum"; then
$SUDO apt-get install zsh -y sudo apt-get install zsh -y
elif command_exists "pacman"; then elif command_exists "pacman"; then
$SUDO pacman -S zsh --noconfirm --needed sudo pacman -S zsh --noconfirm --needed
elif command_exists "zypper"; then elif command_exists "zypper"; then
$SUDO zypper install zsh -y sudo zypper install zsh -y
elif command_exists "emerge"; then elif command_exists "emerge"; then
$SUDO emerge --ask app-shells/zsh sudo emerge app-shells/zsh
$SUDO emerge --ask app-shells/zsh-completions sudo emerge app-shells/zsh-completions
$SUDO emerge --ask app-shells/gentoo-zsh-completions sudo emerge app-shells/gentoo-zsh-completions
elif command_exists "apk"; then elif command_exists "apk"; then
$SUDO apk add zsh -y sudo apk add zsh -y
else else
echo >&2 "Unsupported: unknown package manager" echo >&2 "Unsupported: unknown package manager"
exit 1 exit 1