33 lines
900 B
Bash
33 lines
900 B
Bash
#!/bin/sh
|
|
|
|
software="https://git.amolinae.com/amolinae06/installer/raw/branch/main/software.csv"
|
|
|
|
upgrade(){
|
|
printf "Updating Alpine Linux"
|
|
doas apk update; doas apk upgrade
|
|
printf "Successfully updated Alpine Linux"
|
|
}
|
|
|
|
apk_add(){
|
|
doas apk add "$1" >/dev/null 2>&1; echo "Installing $1"
|
|
}
|
|
|
|
read_software(){
|
|
[ -d "$HOME/.local/src/" ] || mkdir -p "$HOME/.local/src/"
|
|
|
|
([ -f "$1" ] && cp "$1" /tmp/temp.csv) || wget -qO- "$1" > /tmp/temp.csv
|
|
|
|
tail -n +2 "/tmp/temp.csv" | sed -E ':a; s/("[^"]*),([^"]*")/\1\2/; ta' | while IFS=',' read -r NAME DESCRIPTION GIT GIT_URL; do
|
|
case "$GIT" in
|
|
"N") apk_add "$NAME" ;;
|
|
#"Y") git_install "$GIT_URL" ;;
|
|
#"D") bwapk_install "$NAME" ;;
|
|
*) echo "ERROR: failed to determine "$NAME"'s origin"; exit 1 ;;
|
|
esac
|
|
done
|
|
|
|
rm "/tmp/temp.csv"
|
|
printf "Successfully installed all software\n"
|
|
}
|
|
|
|
upgrade; read_software; exit 0
|