aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/update_apt-panopticon
diff options
context:
space:
mode:
authoronefang2022-10-18 11:54:57 +1000
committeronefang2022-10-18 11:54:57 +1000
commit83e25cf1768ba1f1504ce91f1deb0cd289836e2f (patch)
treee4b8a707760daba55b3550c06605236b7e75e4e2 /update_apt-panopticon
parentOnly git pull if it's a git version. (diff)
downloadapt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.zip
apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.tar.gz
apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.tar.bz2
apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.tar.xz
Check for stale lock file.
Diffstat (limited to '')
-rwxr-xr-xupdate_apt-panopticon14
1 files changed, 10 insertions, 4 deletions
diff --git a/update_apt-panopticon b/update_apt-panopticon
index f2f3387..7bbe1d7 100755
--- a/update_apt-panopticon
+++ b/update_apt-panopticon
@@ -11,10 +11,16 @@ if [ -f .git ] ; then
11 #chown -R mirrors:www-data * 11 #chown -R mirrors:www-data *
12fi 12fi
13 13
14if [ ! -f apt-panopticon.lock ] ; then 14# Check if the lock file still exists.
15 rm ../results; ln -s apt-panopticon/results_old ../results 15if [ -f apt-panopticon.lock ] ; then
16 flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock 16 # Check if it's still running.
17 rm ../results; ln -s apt-panopticon/results ../results 17 ps ax -eo pid,args | grep "luajit ./apt-panopticon.lua" | grep -v "grep luajit ./apt-panopticon.lua" | while read line ; do echo "Previous apt-panopticon still running, exiting." exit 1 ; done
18 echo "Crashed apt-panopticon detected, removing stale lock file."
19 rm apt-panopticon.lock
18fi 20fi
19 21
22rm ../results; ln -s apt-panopticon/results_old ../results
23flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock
24rm ../results; ln -s apt-panopticon/results ../results
25
20#chown -R mirrors:www-data /var/www/html/SledjHamr/apt-panopticon/results 26#chown -R mirrors:www-data /var/www/html/SledjHamr/apt-panopticon/results