small changes
mostly formatting and changed concatination of some commands
This commit is contained in:
parent
42e636c83f
commit
7f00d23c6c
29
update
29
update
@ -2,7 +2,7 @@
|
|||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
|
|
||||||
# updates via an aur-helper and flatpak with flags
|
# updates via an aur-helper and flatpak with flags
|
||||||
# version 0.3
|
# version 0.4
|
||||||
|
|
||||||
# add options to change aur-helper in the config
|
# add options to change aur-helper in the config
|
||||||
# maybe make a first time setup, which asks for backup_location and aur_helper, maybe even if you wanna opt-in to non-interactive flatpak-update (maybe a flag?)
|
# maybe make a first time setup, which asks for backup_location and aur_helper, maybe even if you wanna opt-in to non-interactive flatpak-update (maybe a flag?)
|
||||||
@ -15,15 +15,7 @@ NC="\033[0m" # Text Reset
|
|||||||
if [ -f ~/.config/update/update.conf ]; then
|
if [ -f ~/.config/update/update.conf ]; then
|
||||||
source ~/.config/update/update.conf;
|
source ~/.config/update/update.conf;
|
||||||
else
|
else
|
||||||
echo "# Backup to this folder
|
cp ~/bin/update_bash/update.conf ~/.config/update/update.conf && echo -e "${IGreen} created config file ${NC}" && source ~/.config/update/update.conf
|
||||||
backup_location=~/
|
|
||||||
|
|
||||||
# use this aur-helper
|
|
||||||
aur_helper=yay
|
|
||||||
|
|
||||||
# if you should backup or not
|
|
||||||
# should stay true unless you know what you're doing
|
|
||||||
should_backup=true" > ~/.config/update/update.conf && echo -e "${IGreen} created config file ${NC}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# output if wrong flag is used
|
# output if wrong flag is used
|
||||||
@ -67,11 +59,11 @@ update_with_aur_helper() {
|
|||||||
|
|
||||||
# updates using flatpak update
|
# updates using flatpak update
|
||||||
update_with_flatpak() {
|
update_with_flatpak() {
|
||||||
flatpak update -uy --noninteractive
|
flatpak update -u --noninteractive
|
||||||
flatpak list > ~/flatpak-after.txt
|
flatpak list > ~/flatpak-after.txt
|
||||||
}
|
}
|
||||||
|
|
||||||
[[ "$should_backup" = true ]] && before_backup && echo -e "${IGreen} pre-backup complete ${NC}"
|
[[ $should_backup ]] && before_backup && echo -e "${IGreen} pre-backup complete ${NC}"
|
||||||
|
|
||||||
[[ -z $1 ]] && update_with_aur_helper && update_with_flatpak;
|
[[ -z $1 ]] && update_with_aur_helper && update_with_flatpak;
|
||||||
while getopts 'fyagr' OPTION; do
|
while getopts 'fyagr' OPTION; do
|
||||||
@ -81,22 +73,17 @@ while getopts 'fyagr' OPTION; do
|
|||||||
y)
|
y)
|
||||||
update_with_aur_helper ;;
|
update_with_aur_helper ;;
|
||||||
a)
|
a)
|
||||||
update_with_aur_helper
|
update_with_aur_helper; update_with_flatpak ;;
|
||||||
update_with_flatpak ;;
|
|
||||||
g)
|
g)
|
||||||
[[ $1 = -g ]] && update_with_aur_helper && update_with_flatpak;
|
[[ $1 = -g ]] && update_with_aur_helper && update_with_flatpak;
|
||||||
after_backup && echo -e "${IGreen} after-backup complete ${NC}"
|
after_backup && echo -e "${IGreen} after-backup complete ${NC}" && sleep 15s && shutdown now ;;
|
||||||
sleep 15s
|
|
||||||
shutdown now ;;
|
|
||||||
r)
|
r)
|
||||||
[[ $1 = -r ]] && update_with_aur_helper && update_with_flatpak;
|
[[ $1 = -r ]] && update_with_aur_helper && update_with_flatpak;
|
||||||
after_backup && echo -e "${IGreen} after-backup complete ${NC}"
|
after_backup && echo -e "${IGreen} after-backup complete ${NC}" && sleep 5s && reboot ;;
|
||||||
sleep 5s
|
|
||||||
reboot ;;
|
|
||||||
?)
|
?)
|
||||||
Help
|
Help
|
||||||
exit 1;;
|
exit 1;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
[[ "$should_backup" = true ]] && after_backup && echo -e "${IGreen} after-backup complete ${NC}"
|
[[ $should_backup ]] && after_backup && echo -e "${IGreen} after-backup complete ${NC}"
|
Loading…
x
Reference in New Issue
Block a user