aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-02-14 16:37:18 +0100
committerGravatar Christian Hesse <mail@eworm.de>2020-02-14 16:41:05 +0100
commit2b908f4f86eb1c7dc16e49e0b820133e34163814 (patch)
tree1606807a583d4ac4944ab3497fb86133491746e3 /bin
parent65c8e0638b90d619ea8450f37af832af9b657fd1 (diff)
downloadpacman-offline-2b908f4f86eb1c7dc16e49e0b820133e34163814.tar.gz
pacman-offline-2b908f4f86eb1c7dc16e49e0b820133e34163814.tar.zst
add option to start reboot timer
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pacman-offline10
1 files changed, 9 insertions, 1 deletions
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