diff options
author | onefang | 2022-10-18 11:54:57 +1000 |
---|---|---|
committer | onefang | 2022-10-18 11:54:57 +1000 |
commit | 83e25cf1768ba1f1504ce91f1deb0cd289836e2f (patch) | |
tree | e4b8a707760daba55b3550c06605236b7e75e4e2 | |
parent | Only git pull if it's a git version. (diff) | |
download | apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.zip apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.tar.gz apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.tar.bz2 apt-panopticon-83e25cf1768ba1f1504ce91f1deb0cd289836e2f.tar.xz |
Check for stale lock file.
-rwxr-xr-x | update_apt-panopticon | 14 |
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 * |
12 | fi | 12 | fi |
13 | 13 | ||
14 | if [ ! -f apt-panopticon.lock ] ; then | 14 | # Check if the lock file still exists. |
15 | rm ../results; ln -s apt-panopticon/results_old ../results | 15 | if [ -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 | ||
18 | fi | 20 | fi |
19 | 21 | ||
22 | rm ../results; ln -s apt-panopticon/results_old ../results | ||
23 | flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock | ||
24 | rm ../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 |