basesystem: fix updateanleitung

This commit is contained in:
teldra 2021-04-07 17:52:24 +02:00
parent 89226bd8ef
commit 9dc6d6b588

View File

@ -47,11 +47,11 @@ echo 'ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotationa
mkdir -p /etc/bash/bashrc.d/ mkdir -p /etc/bash/bashrc.d/
{ echo "[ \"\$(id -u)\" -eq 0 ] && return"; { echo "[ \"\$(id -u)\" -eq 0 ] && return";
echo 'alias xu="sudo xi -Su"'; echo 'alias xu="sudo voidupdate"';
echo 'alias xr="sudo xbps-install -R"'; echo 'alias xr="sudo xbps-install -R"';
echo 'alias xs="xbps-query -Rs"'; echo 'alias xs="xbps-query -Rs"';
echo 'alias xk="sudo vkpurge rm all"'; echo 'alias xk="sudo vkpurge rm all"';
echo 'echo "xu = sudo xbps-install -Su zum updaten"'; echo 'echo "xu = sudo voidupdate zum updaten"';
echo 'echo "xi = sudo xbps-install -S zum installieren"'; echo 'echo "xi = sudo xbps-install -S zum installieren"';
echo 'echo "xr = sudo xbps-install -R zum deinstallieren"'; echo 'echo "xr = sudo xbps-install -R zum deinstallieren"';
echo 'echo "xs = xbps-query -Rs zum suchen"'; echo 'echo "xs = xbps-query -Rs zum suchen"';
@ -99,4 +99,45 @@ echo " subvolume home" >> /etc/btrbk/btrbk.conf
mkdir -p /var/spool/cron/ mkdir -p /var/spool/cron/
echo "0 */2 * * * /usr/bin/btrbk -q run snapshot" >> /var/spool/cron/root echo "0 */2 * * * /usr/bin/btrbk -q run snapshot" >> /var/spool/cron/root
cat << 'EOF' > /usr/local/bin/voidupdate
#!/bin/bash
RESTART=
echo "Synchronisiere Repositorys"
xbps-install -S > /dev/null
mapfile -t updatedpkgs < <(xbps-install -un|awk '{print $1}')
if [[ "${#updatedpkgs[@]}" -eq 0 ]]; then
echo "Keine Updates"
exit
fi
echo "Entferne nicht benutzte Pakete"
xbps-remove -oy > /dev/null
echo "Räume den Cache auf"
xbps-remove -Oy > /dev/null
echo "Installiere Updates"
xbps-install -u
if [[ "$(xcheckrestart)" ]]; then
RESTART=1
fi
for i in "${updatedpkgs[@]}"; do
if grep "^linux-" <<< "${i}"; then
vkpurge list | head -n -1 | xargs -r vkpurge rm
RESTART=1
fi
done
if [[ "${RESTART}" ]]; then
echo ""; echo "Bitte den Computer neu starten."
fi
echo ""
echo "Update fertig."
EOF
module end module end