From 7c25a42cff108b6bbc068461a32896649f59ae57 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 1 Jul 2019 08:57:43 +0200 Subject: add reboot option --- bin/pacman-offline | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/bin/pacman-offline b/bin/pacman-offline index 9976742..4a28dac 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -7,10 +7,13 @@ function help() { echo echo ' -f force if other system-update is pending' echo ' -h this help' + echo ' -r reboot and install immediately' echo ' -y update sync databases' } -while getopts 'fhy' opt; do +REBOOT=0 + +while getopts 'fhry' opt; do case ${opt} in f) rm -f /system-update @@ -19,6 +22,9 @@ while getopts 'fhy' opt; do help exit 0 ;; + r) + REBOOT=1 + ;; y) pacman -Sy ;; @@ -45,3 +51,8 @@ pacman -Suw --noconfirm # enable system update ln -sf /var/cache/pacman/pkg /system-update + +# reboot if requested +if [ ${REBOOT} -eq 1 ]; then + systemctl reboot +fi -- cgit v1.2.3-70-g09d2