diff options
| author | onefang | 2022-10-18 13:33:34 +1000 |
|---|---|---|
| committer | onefang | 2022-10-18 13:33:34 +1000 |
| commit | d70e8ff536c6307d9d5fea5a1044670f3b334ae9 (patch) | |
| tree | 188b5385d60623d35350e6ad7d5fd2b65c532577 | |
| parent | Moar chown changes. (diff) | |
| download | apt-panopticon-d70e8ff536c6307d9d5fea5a1044670f3b334ae9.zip apt-panopticon-d70e8ff536c6307d9d5fea5a1044670f3b334ae9.tar.gz apt-panopticon-d70e8ff536c6307d9d5fea5a1044670f3b334ae9.tar.bz2 apt-panopticon-d70e8ff536c6307d9d5fea5a1044670f3b334ae9.tar.xz | |
Actually exit when still running.
| -rwxr-xr-x | update_apt-panopticon | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/update_apt-panopticon b/update_apt-panopticon index ebd5e45..219d86a 100755 --- a/update_apt-panopticon +++ b/update_apt-panopticon | |||
| @@ -14,7 +14,12 @@ fi | |||
| 14 | # Check if the lock file still exists. | 14 | # Check if the lock file still exists. |
| 15 | if [ -f apt-panopticon.lock ] ; then | 15 | if [ -f apt-panopticon.lock ] ; then |
| 16 | # Check if it's still running. | 16 | # Check if it's still running. |
| 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 | 17 | ps ax -eo pid,args | grep "luajit ./apt-panopticon.lua" | grep -v "grep luajit ./apt-panopticon.lua" | while read line ; do touch apt-panopticon.running ; exit ; done |
| 18 | if [ -f apt-panopticon.running ] ; then | ||
| 19 | echo "Previous apt-panopticon still running, exiting." | ||
| 20 | rm apt-panopticon.running | ||
| 21 | exit 1 | ||
| 22 | fi | ||
| 18 | echo "Crashed apt-panopticon detected, removing stale lock file." | 23 | echo "Crashed apt-panopticon detected, removing stale lock file." |
| 19 | rm apt-panopticon.lock | 24 | rm apt-panopticon.lock |
| 20 | fi | 25 | fi |
