post install script
This commit is contained in:
parent
a21989bf15
commit
b1079497c8
3 changed files with 87 additions and 24 deletions
48
postinstall.sh
Normal file
48
postinstall.sh
Normal file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/sh
|
||||
|
||||
software="https://git.amolinae.com/amolinae06/installer/raw/branch/main/devware.csv"
|
||||
|
||||
apk_install(){
|
||||
echo "installing $1"; bwroot apk add "$1" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
read_software(){
|
||||
([ -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
|
||||
"D") apk_install $NAME ;;
|
||||
*) echo "ERROR: failed to determine $NAME."; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
rm "/tmp/temp.csv"
|
||||
printf "Successfully installed all software!\n"
|
||||
}
|
||||
|
||||
make_dwl() {
|
||||
cd $HOME/.local/src/dwl/
|
||||
bwroot make install
|
||||
}
|
||||
|
||||
make_slstatus() {
|
||||
cd $HOME/.local/src/slstatus/
|
||||
bwroot make install
|
||||
}
|
||||
|
||||
make_ctpv() {
|
||||
cd $HOME/.local/src/hellwal/
|
||||
bwroot make install
|
||||
}
|
||||
|
||||
make_hellwal() {
|
||||
cd $HOME/.local/src/hellwal/
|
||||
bwroot make install
|
||||
}
|
||||
|
||||
cd "/home/$@/"
|
||||
read_software $software
|
||||
make_dwl
|
||||
make_slstatus
|
||||
make_ctpv
|
||||
make_hellwal
|
Loading…
Add table
Add a link
Reference in a new issue