fix alpine update script to use shared cache

This commit is contained in:
Daniel Sommer 2024-11-05 16:12:57 +01:00
parent 9ceae1e7f1
commit 4c0fd1c103

View file

@ -19,7 +19,7 @@ for arg in "$@"; do
noconfirm="true"
;;
-r|--reboot)
reboot="true"G
reboot="true"
;;
esac
done
@ -27,12 +27,11 @@ done
printf ""$font_colored_bold">> system update started..."$font_default"\n"
printf ""$font_colored"> updating packages..."$font_default"\n"
[[ "$noconfirm" ]] && apk update --progress || apk update --progress --interactive
[[ "$noconfirm" ]] && apk upgrade --progress || apk update --progress --interactive
[[ "$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/*"
#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