fix alpine update script

This commit is contained in:
Daniel Sommer 2024-11-05 16:27:47 +01:00
parent 4c0fd1c103
commit 32f8ce1c55

View file

@ -29,10 +29,6 @@ printf ""$font_colored_bold">> system update started..."$font_default"\n"
printf ""$font_colored"> updating packages..."$font_default"\n"
[[ "$noconfirm" ]] && apk --update-cache upgrade --progress || apk --update-cache upgrade --progress --interactive
#printf ""$font_colored"> cleaning cache..."$font_default"\n"
#apk cache clean &> /dev/null
#rm -rf "/var/cache/apk/*"
orphans="$(apk list --orphaned | awk '{print $1}' 2> /dev/null)"
if [[ "$orphans" ]]; then
orphans="$(printf "$orphans" | tr '\n' ' ')"
@ -45,6 +41,10 @@ fi
script="$(dirname $(realpath $0))/conf.d/$(hostname).sh"
[[ -x "$script" ]] && printf ""$font_colored"> executing script "$script"..."$font_default"\n" && (. "$script")
printf ""$font_colored"> cleaning cache..."$font_default"\n"
apk cache clean &> /dev/null
rm -rf "/var/cache/apk/*"
printf ""$font_colored_bold">> system updated finished!"$font_default"\n"
[[ ! "$reboot" ]] && exit 0