Update .local/bin/provision

This commit is contained in:
Brian Zalewski 2022-11-30 08:18:47 +00:00
parent 0acf81202a
commit dedcb84911

View file

@ -2,14 +2,15 @@
set -eo pipefail set -eo pipefail
### Qubes dom0 specific code at top ### Qubes dom0
# The VM name that will manage the Ansible provisioning (for Qubes dom0) if command -v qubesctl > /dev/null; then
ANSIBLE_PROVISION_VM="provision" # The VM name that will manage the Ansible provisioning (for Qubes dom0)
ANSIBLE_PROVISION_VM="provision"
# Ensure sys-whonix is configured (for Qubes dom0) # Ensure sys-whonix is configured (for Qubes dom0)
CONFIG_WIZARD_COUNT=0 CONFIG_WIZARD_COUNT=0
ENABLE_OBFSC='false' ENABLE_OBFSC='false'
function configureWizard() { function configureWizard() {
if xwininfo -root -tree | grep "Anon Connection Wizard"; then if xwininfo -root -tree | grep "Anon Connection Wizard"; then
WINDOW_ID="$(xwininfo -root -tree | grep "Anon Connection Wizard" | sed 's/^ *\([^ ]*\) .*/\1/')" WINDOW_ID="$(xwininfo -root -tree | grep "Anon Connection Wizard" | sed 's/^ *\([^ ]*\) .*/\1/')"
xdotool windowactivate "$WINDOW_ID" && sleep 1 && xdotool key 'Enter' && sleep 1 && xdotool key 'Tab Tab Enter' && sleep 24 && xdotool windowactivate "$WINDOW_ID" && sleep 1 && xdotool key 'Enter' && sleep 300 xdotool windowactivate "$WINDOW_ID" && sleep 1 && xdotool key 'Enter' && sleep 1 && xdotool key 'Tab Tab Enter' && sleep 24 && xdotool windowactivate "$WINDOW_ID" && sleep 1 && xdotool key 'Enter' && sleep 300
@ -33,11 +34,7 @@ function configureWizard() {
configureWizard configureWizard
fi fi
fi fi
} }
### Update via system package manager and install Homebrew dependencies
if command -v qubesctl > /dev/null; then
# Qubes dom0
### Ensure dom0 is updated ### Ensure dom0 is updated
if [ ! -f /root/dom0-updated ]; then if [ ! -f /root/dom0-updated ]; then
@ -82,44 +79,48 @@ if command -v qubesctl > /dev/null; then
fi fi
qvm-run --pass-io "$ANSIBLE_PROVISION_VM" 'curl -sSL https://install.doctor/start > ~/start.sh && bash ~/start.sh' qvm-run --pass-io "$ANSIBLE_PROVISION_VM" 'curl -sSL https://install.doctor/start > ~/start.sh && bash ~/start.sh'
exit 0 exit 0
elif command -v apt-get > /dev/null; then fi
### System package manager update / Homebrew dependencies
if ! command -v curl > /dev/null || ! command -v git > /dev/null; then
if command -v apt-get > /dev/null; then
# Debian / Ubuntu # Debian / Ubuntu
sudo apt-get update sudo apt-get update
sudo apt-get install -y curl git sudo apt-get install -y curl git
elif command -v dnf > /dev/null; then elif command -v dnf > /dev/null; then
# Fedora # Fedora
sudo dnf install -y curl git sudo dnf install -y curl git
elif command -v yum > /dev/null; then elif command -v yum > /dev/null; then
# CentOS # CentOS
sudo yum install -y curl git sudo yum install -y curl git
elif command -v pacman > /dev/null; then elif command -v pacman > /dev/null; then
# Archlinux # Archlinux
sudo pacman update sudo pacman update
sudo pacman -Sy curl git sudo pacman -Sy curl git
elif command -v zypper > /dev/null; then elif command -v zypper > /dev/null; then
# OpenSUSE # OpenSUSE
sudo zypper install -y curl git nodejs sudo zypper install -y curl git nodejs
elif command -v apk > /dev/null; then elif command -v apk > /dev/null; then
# Alpine # Alpine
apk add curl git apk add curl git
elif [ -d /Applications ] && [ -d /Library ]; then elif [ -d /Applications ] && [ -d /Library ]; then
# macOS # macOS
sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install sudo xcode-select -p >/dev/null 2>&1 || xcode-select --install
elif command -v nix-env > /dev/null; then elif command -v nix-env > /dev/null; then
# NixOS # NixOS
echo "TODO - Add support for NixOS" echo "TODO - Add support for NixOS"
elif [[ "$OSTYPE" == 'freebsd'* ]]; then elif [[ "$OSTYPE" == 'freebsd'* ]]; then
# FreeBSD # FreeBSD
echo "TODO - Add support for FreeBSD" echo "TODO - Add support for FreeBSD"
elif command -v pkg > /dev/null; then elif command -v pkg > /dev/null; then
# Termux # Termux
echo "TODO - Add support for Termux" echo "TODO - Add support for Termux"
elif command -v xbps-install > /dev/null; then elif command -v xbps-install > /dev/null; then
# Void # Void
echo "TODO - Add support for Void" elif [[ "$OSTYPE" == 'cygwin' ]] || [[ "$OSTYPE" == 'msys' ]] || [[ "$OSTYPE" == 'win32' ]]; then
elif [[ "$OSTYPE" == 'cygwin' ]] || [[ "$OSTYPE" == 'msys' ]] || [[ "$OSTYPE" == 'win32' ]]; then
# Windows # Windows
choco install -y curl git node choco install -y curl git node
fi
fi fi
### Install Homebrew ### Install Homebrew