From 55ab599accfc6eaf1894f715b49457116d8cde5c Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 12 Sep 2024 09:14:23 +0200 Subject: support to abort from pacman-offline --- bin/pacman-offline | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'bin') diff --git a/bin/pacman-offline b/bin/pacman-offline index 58b81f2..5597faf 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -12,6 +12,7 @@ set -e function help() { echo "usage: ${0} [OPTIONS]" echo + echo ' -a abort pending system-update' echo ' -c clean before download' echo ' -f force if other system-update is pending' echo ' -h this help' @@ -26,13 +27,13 @@ POWEROFF=0 REBOOT=0 TIMER=0 -while getopts 'cfhprty' opt; do +while getopts 'acfhprty' opt; do case ${opt} in h) help exit 0 ;; - c|f|p|r|t|y) + a|c|f|p|r|t|y) ;; *) exit 1 @@ -51,8 +52,16 @@ if [ "${UID}" -ne 0 ]; then fi OPTIND=1 -while getopts 'cfhprty' opt; do +while getopts 'acfhprty' opt; do case ${opt} in + a) + rm --force \ + /system-update \ + /run/systemd/system/systemd-poweroff.service \ + /run/systemd/system/systemd-reboot.service + systemctl daemon-reload + exit 0 + ;; c) if pacman-conf 'CleanMethod' | grep -q 'KeepCurrent'; then CLEAN=1 -- cgit v1.2.3-70-g09d2