merge remote changes

This commit is contained in:
Daniel Sommer 2024-11-05 16:33:30 +01:00
commit 4d6c30d30a
4 changed files with 17 additions and 12 deletions

View file

@ -34,6 +34,6 @@ while true; do
continue
fi
printf "> #"$counter": scanning to '"$file"' finished!\n"
postprocess "$file" "$directory" "$counter"
#postprocess "$file" "$directory" "$counter"
((counter++))
done

View file

@ -19,7 +19,7 @@ for arg in "$@"; do
noconfirm="true"
;;
-r|--reboot)
reboot="true"G
reboot="true"
;;
esac
done
@ -27,12 +27,7 @@ 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
printf ""$font_colored"> cleaning cache..."$font_default"\n"
apk cache clean &> /dev/null
rm -rf "/var/cache/apk/*"
[[ "$noconfirm" ]] && apk --update-cache upgrade --progress || apk --update-cache upgrade --progress --interactive
orphans="$(apk list --orphaned | awk '{print $1}' 2> /dev/null)"
if [[ "$orphans" ]]; then
@ -46,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

View file

@ -25,6 +25,9 @@ for arg in "$@"; do
esac
done
# sudo
sudo id -u 2&> /dev/null
printf "${BOLD}${YELLOW}>> starting system update...${DEFAULT}\n"
# upgrade installed packages

View file

@ -8,16 +8,19 @@ distro="$(grep "^ID" /etc/*release | cut -d "=" -f2)"
script="$(dirname $(realpath $0))/$distro.sh"
# check if update script exists
[[ ! -x "$script" ]] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1
[ ! -x "$script" ] && printf "error: update script '"$script"' does not exist or is not executable!\n" >&2 && exit 1
args=""
for arg in "$@"; do
[[ -n "$args" ]] && args="$args "
[ -n "$args" ] && args="$args "
args="$args$arg"
done
# execute update script
if [[ "$EUID" == "0" ]]; then
#if [ "$distro" == "arch" ]; then
# "$script" $args
if [ "$(id -u)" -eq 0 ] || [ "$distro" == "arch" ]; then
#elif [ "$(id -u)" -eq 0 ]; then
"$script" $args
else
sudo "$script" $args