summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-07-01 08:57:43 +0200
committerGravatar Christian Hesse <mail@eworm.de>2019-07-01 08:59:47 +0200
commit7c25a42cff108b6bbc068461a32896649f59ae57 (patch)
treee013e66e877cda4acd57130fbd94fe4c68ce3378
parent65f653c9618512d0f570e75fba4498fc10953918 (diff)
downloadpacman-offline-7c25a42cff108b6bbc068461a32896649f59ae57.tar.gz
pacman-offline-7c25a42cff108b6bbc068461a32896649f59ae57.tar.zst
add reboot option
-rwxr-xr-xbin/pacman-offline13
1 files changed, 12 insertions, 1 deletions
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