fix: shellcheck warnings

master
aldum 12 months ago
parent d13728d293
commit 2ebba5026a
  1. 24
      common
  2. 13
      install

@ -1,17 +1,17 @@
#!/bin/bash
DEVICE=/dev/sda
MOUNT=/mnt/newstrap
INIT=runit
USERNAME=aldum
KERNEL=linux
TIMEZONE=Europe/Budapest
progsfile=progs.csv
export DEVICE=/dev/sda
export MOUNT=/mnt/newstrap
export INIT=runit
export USERNAME=aldum
export KERNEL=linux
export TIMEZONE=Europe/Budapest
export progsfile=progs.csv
VIDEO=xf86-video-intel
export VIDEO=xf86-video-intel
sanity() {
[ -z "$MOUNT" ] && { echo 'Check settings' ; exit -1; }
[ -z "$MOUNT" ] && { echo 'Check settings' ; exit 1; }
# TODO: check if it is mounted, display drive info, ask for confirmation
}
@ -26,7 +26,7 @@ enable() {
'openrc') rc-update add "$service" ;;
'runit') ln -s /etc/runit/sv/"$service" /etc/runit/runsvdir/default;;
's6') s6-rc-bundle -c /etc/s6/rc/compiled add default "$service" ;;
*) exit -2 ;;
*) exit 2 ;;
esac
}
@ -36,9 +36,9 @@ manualinstall() { # Installs $1 manually if not installed. Used only for AUR hel
cd /tmp || exit
rm -rf /tmp/"$1"*
curl -sO https://aur.archlinux.org/cgit/aur.git/snapshot/"$1".tar.gz &&
sudo -u "$name" tar -xvf "$1".tar.gz >/dev/null 2>&1 &&
sudo -u "$USERNAME" tar -xvf "$1".tar.gz >/dev/null 2>&1 &&
cd "$1" &&
sudo -u "$name" makepkg --noconfirm -si >/dev/null 2>&1
sudo -u "$USERNAME" makepkg --noconfirm -si >/dev/null 2>&1
cd /tmp || return) ;
}

@ -6,19 +6,20 @@ sanity
do_install() { \
# dialog --title "AAS Installation" --infobox "Installing \`$1\` ($n of $total). $1 $2" 5 70
artools-chroot $MOUNT sudo -u $USERNAME yay -S --noconfirm "$1" 2>&1
artools-chroot "$MOUNT" sudo -u "$USERNAME" yay -S --noconfirm "$1" 2>&1
}
installationloop() { \
artools-chroot $MOUNT sudo -u $USERNAME yay -Syy --noconfirm 2>&1
artools-chroot "$MOUNT" sudo -u "$USERNAME" yay -Syy --noconfirm 2>&1
PROGS="/tmp/progs.csv"
# ([ -f "$progsfile" ] && sed -r -e "s/@@VIDEO@@/$VIDEO/" "$progsfile" > /tmp/progs.csv) || curl -Ls "$progsfile" | sed '/^#/d' > /tmp/progs.csv
[ -f "$progsfile" ] && sed -r -e '/^#/d' -e "s/@@VIDEO@@/$VIDEO/" "$progsfile" > $PROGS
total=$(wc -l < $PROGS)
# aurinstalled=$(pacman -Qm | awk '{print $1}')
[ -f "$PROGS" ] && sed -r -e '/^#/d' -e "s/@@VIDEO@@/$VIDEO/" "$progsfile" > $PROGS
# total=$(wc -l < $PROGS)
# aurinstalled=$(pacman -Qm | awk '{print $1}')
while IFS=, read -r tag program comment; do
n=$((n+1))
echo "$comment" | grep "^\".*\"$" >/dev/null 2>&1 && comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")"
echo "$comment" | grep "^\".*\"$" >/dev/null 2>&1 && \
comment="$(echo "$comment" | sed "s/\(^\"\|\"$\)//g")"
case "$tag" in
"") do_install "$program" "$comment" ;;
"A") do_install "$program" "$comment" ;;

Loading…
Cancel
Save