summaryrefslogtreecommitdiffstats
path: root/abs/core/pacman/pacman.cron
diff options
context:
space:
mode:
authorBritney Fransen <brfransen@gmail.com>2015-07-15 18:48:24 (GMT)
committerBritney Fransen <brfransen@gmail.com>2015-07-15 18:48:24 (GMT)
commit9768a70e6845b39e4b61f494aedc8f0c5757834c (patch)
treebeaedcbcda1454ab88bf0cc09ede584e01848509 /abs/core/pacman/pacman.cron
parent8818abda9545c04ebf135fef63a2baa7ebec9e49 (diff)
downloadlinhes_pkgbuild-9768a70e6845b39e4b61f494aedc8f0c5757834c.zip
linhes_pkgbuild-9768a70e6845b39e4b61f494aedc8f0c5757834c.tar.gz
linhes_pkgbuild-9768a70e6845b39e4b61f494aedc8f0c5757834c.tar.bz2
pacman: automate updating pacman db
Diffstat (limited to 'abs/core/pacman/pacman.cron')
-rw-r--r--abs/core/pacman/pacman.cron20
1 files changed, 20 insertions, 0 deletions
diff --git a/abs/core/pacman/pacman.cron b/abs/core/pacman/pacman.cron
new file mode 100644
index 0000000..9155aed
--- /dev/null
+++ b/abs/core/pacman/pacman.cron
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+function pacman_wait {
+ if [ -f /var/lib/pacman/db.lck ]
+ then
+ echo "Pacman is running and must quit before continuing."
+ echo " Waiting for pacman to quit..."
+ while [ -f /var/lib/pacman/db.lck ]
+ do
+ sleep 5
+ done
+ fi
+}
+
+pacman_wait
+pacman-db-upgrade &
+#remove pacman.cron from root crontab
+grep -v "* * * * * /usr/bin/bash /usr/MythVantage/bin/pacman.cron" /var/spool/cron/root > /var/spool/cron/root2
+mv /var/spool/cron/root2 /var/spool/cron/root
+echo "root" >> /var/spool/cron/cron.update