From 2b908f4f86eb1c7dc16e49e0b820133e34163814 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 14 Feb 2020 16:37:18 +0100 Subject: add option to start reboot timer --- bin/pacman-offline | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/pacman-offline b/bin/pacman-offline index 0105f54..1a7c794 100755 --- a/bin/pacman-offline +++ b/bin/pacman-offline @@ -8,12 +8,14 @@ function help() { echo ' -f force if other system-update is pending' echo ' -h this help' echo ' -r reboot and install immediately' + echo ' -t start timer for nightly reboot' echo ' -y update sync databases' } REBOOT=0 +TIMER=0 -while getopts 'fhry' opt; do +while getopts 'fhrty' opt; do case ${opt} in f) rm -f /system-update @@ -25,6 +27,9 @@ while getopts 'fhry' opt; do r) REBOOT=1 ;; + t) + TIMER=1 + ;; y) pacman --sync --refresh ;; @@ -60,4 +65,7 @@ ln -sf /var/cache/pacman/pkg /system-update # reboot if requested if [ ${REBOOT} -eq 1 ]; then systemctl reboot +# start timer if requested +elif [ ${TIMER} -eq 1 ]; then + systemctl start pacman-offline-reboot.timer fi -- cgit v1.2.3-54-g00ecf