Fixed bugs
This commit is contained in:
parent
2ff6f04d16
commit
3236d16220
20
fresh.sh
20
fresh.sh
@ -1,14 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
logfile="/dev/null"
|
||||
|
||||
# Get params
|
||||
while getopts "r:p:d:v:h" opt;
|
||||
while getopts "r:p:d:vh" opt;
|
||||
do case $opt in
|
||||
h) echo -e "-r: https://link-to-repo\n-p: /link/to/prog/file\n-d: devicename for special dotfiles\n-v: verbose, please supply logfile path (default is $HOME/install.log)" && exit ;;
|
||||
d) device=${OPTARG} ;;
|
||||
r) repo=${OPTARG} && git ls-remote "$repo" || exit ;;
|
||||
p) prog=${OPTARG} ;;
|
||||
a) aurhelper=${OPTARG} ;;
|
||||
v) logfile=${OPTARG} ;;
|
||||
v) logfile="$scriptdir/install.log" ;;
|
||||
\?) echo "-$OPTARG is not valid" >&2 && exit ;;
|
||||
esac
|
||||
done
|
||||
@ -18,11 +20,7 @@ device=${device:="480"}
|
||||
repo=${repo:="https://toerd@bitbucket.org/toerd/dotfiles"}
|
||||
prog=${prog:="$scriptdir/pack.list"}
|
||||
aurhelper=${aurhelper:="yay"}
|
||||
logfile=${logfile:="$scriptdir/install.log"}
|
||||
|
||||
if [ -z ${v+x} ]; then
|
||||
logfile="/dev/null"
|
||||
fi
|
||||
|
||||
startup_msg() {
|
||||
curr_platform=$(dialog --clear --title "Welcome to the installer <3" --menu "Choose your current platform:" 0 0 2 "L" "Laptop" "D" "Desktop" 2>&1>/dev/tty)
|
||||
@ -65,19 +63,22 @@ create_user() {
|
||||
}
|
||||
|
||||
install_pacman() {
|
||||
dialog --title "Pacman packages" --infobox "Package $n/$ps\n\nInstalling: $1\n\n> $2 <" 0 0
|
||||
psd=$((psd+1))
|
||||
dialog --title "Pacman packages" --infobox "Package $psd/$ps\n\nInstalling: $1\n\n> $2 <" 0 0
|
||||
pacman --noconfirm --needed -S "$1" &>$logfile
|
||||
}
|
||||
|
||||
install_aur() {
|
||||
dialog --title "AUR packages" --infobox "AUR Package $n/$as\n\nInstalling: $1\n\n> $2 <" 0 0
|
||||
asd=$((asd+1))
|
||||
dialog --title "AUR packages" --infobox "AUR Package $asd/$as\n\nInstalling: $1\n\n> $2 <" 0 0
|
||||
# is package already installed?
|
||||
grep "^$1$" <<< "$aur_already_installed" && return
|
||||
sudo -u $uname $aurhelper -S --noconfirm "$1" $>$logfile
|
||||
}
|
||||
|
||||
install_manual() {
|
||||
dialog --title "Manual packages" --infobox "Manual Package $n/$ms\n\nInstalling: $1\n\n> $2 <" 0 0
|
||||
msd=$((msd+1))
|
||||
dialog --title "Manual packages" --infobox "Manual Package $msd/$ms\n\nInstalling: $1\n\n> $2 <" 0 0
|
||||
cd "$scriptdir/packages/$1" || exit
|
||||
make clean && make && sudo -u $uname make install &>$logfile ;
|
||||
cd "/home/$uname" || exit
|
||||
@ -102,7 +103,6 @@ installation_loop() {
|
||||
aur_already_installed=$(pacman -Qqm)
|
||||
#IFS separator
|
||||
while IFS=, read -r platform prefix program info; do
|
||||
n=$((n+1))
|
||||
|
||||
if [[ ${platform} != "A" ]] && [[ ${platform} != ${curr_plattform} ]]; then
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user