harmonize with coredesktop
This commit is contained in:
@@ -49,12 +49,24 @@ mkdir -p "$HOME/.local/bin" "$MINISERVER/updates.d"
|
||||
install_script "$MINISERVER/update" ~/.local/bin/update
|
||||
install_script "$MINISERVER/refresh" ~/.local/bin/refresh
|
||||
install_script "$MINISERVER/sibling" ~/.local/bin/sibling
|
||||
install_script "$MINISERVER/version" ~/.local/bin/version
|
||||
install_script "$MINISERVER/configure" ~/.local/bin/configure
|
||||
|
||||
if [[ -z "$UPDATE_REEXECED" ]]; then
|
||||
export UPDATE_REEXECED=1
|
||||
exec ~/.local/bin/update
|
||||
fi
|
||||
|
||||
# An upgrade that runs out of disk space part way through can leave the system
|
||||
# half-upgraded. Set UPDATE_FORCE=1 to skip this check.
|
||||
MIN_FREE_GIB=10
|
||||
FREE_KIB="$(df -k --output=avail / | tail -n 1 | tr -d ' ')"
|
||||
if [[ -z "$UPDATE_FORCE" && "$FREE_KIB" =~ ^[0-9]+$ ]] && (( FREE_KIB < MIN_FREE_GIB * 1024 * 1024 )); then
|
||||
echo "Only $(( FREE_KIB / 1024 / 1024 )) GiB free on /; updating needs at least $MIN_FREE_GIB GiB."
|
||||
echo "Free up space (sudo paccache -rk1 clears old cached packages), or run: UPDATE_FORCE=1 update"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ask for the password once, then keep sudo's cached credentials fresh until
|
||||
# update exits, so long-running hooks don't stop for a password again.
|
||||
sudo -v || exit 1
|
||||
|
||||
Reference in New Issue
Block a user