summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rwxr-xr-xbin/pacman-offline15
2 files changed, 13 insertions, 3 deletions
diff --git a/README.md b/README.md
index 331ba07..6beb1a7 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,7 @@ Usage
A single command `pacman-offline` is used to prepare the offline update.
It accepts some arguments:
+* *-a*: abort pending system-update
* *-c*: clean before download
* *-f*: force if other system-update is pending
* *-h*: show help
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