summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-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