Compare commits

...

2 Commits

Author SHA1 Message Date
c2bccebbf4 Arch-Installer for yay 2026-05-10 18:42:51 +02:00
2ac236219d Added App-Installer 2026-05-10 18:42:18 +02:00
4 changed files with 60 additions and 1 deletions

0
.gitignore vendored Normal file
View File

View File

@@ -1 +1 @@
Example yay

2
arch/installers/yay.sh Normal file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
sudo pacman -S yay

57
setup.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
URI="https://git.scypher.org/taicrafter/helperScripts/raw/branch/main/"
function _promptBool(){
while true; do
read -r -p "$1 [y/n]: " res < /dev/tty
if [[ "$res" == "Y" || "$res" == "y" ]]; then
return 0;
elif [[ "$res" == "N" || "$res" == "n" ]]; then
return 1;
fi
done
}
function detectOS(){
if [ -f /etc/debian_version ]; then
OS_TYPE="deb"
elif [ -f /etc/arch-release ]; then
OS_TYPE="arch"
else
echo "Unable to detect OS..."
if _promptBool "Manually set to Debian?"; then
OS_TYPE="deb"
elif _promptBool "Manually set to Arch?"; then
OS_TYPE="arch"
else
echo "Failed OS-Detection";
exit 1
fi
fi
echo "Detected OS-Type: $OS_TYPE"
export OS_TYPE
}
function AppInstaller(){
#Get App-List for OS
if _promptBool "Use Source: $URI?"; then
echo "Downloading App List..."
APPS=$(curl -fsSL "$URI/$OS_TYPE/apps.txt");
COUNT=$(echo "$APPS" | wc -l);
#TODO Handle 404 or 0 Installers
echo "Found $COUNT Installers..."
TMP_FILE=$(mktemp)
while IFS= read -r APPNAME; do
#Handle Install
if _promptBool "Install $APPNAME?"; then
echo "Downloading Installer: $URI/$OS_TYPE/$APPNAME.sh"
curl -fsSL "$URI/$OS_TYPE/$APPNAME.sh" -o "$TMP_FILE"
bash "$TMP_FILE"
fi
done <<< "$APPS"
else
echo "Aborted App-Installer!"
fi
}
#Main
detectOS
if _promptBool "Run App-Installer?"; then
AppInstaller
fi