A Lua script to check the health of Devuan Linux package mirrors. The master repo is at https://sledjhamr.org/cgit/apt-panopticon/ and the master issues tracker is at https://sledjhamr.org/mantisbt/project_page.php?project_id=13
https://sledjhamr.org/cgit/apt-panopticon/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1023 B
31 lines
1023 B
#!/bin/bash
|
|
|
|
cd /var/www/html/apt-panopticon/apt-panopticon_cgp
|
|
if [ -d .git ] ; then
|
|
git pull > /dev/null
|
|
chown -R www-data:www-data *
|
|
fi
|
|
cd /var/www/html/apt-panopticon/apt-panopticon
|
|
if [ -d .git ] ; then
|
|
git pull > /dev/null
|
|
chown -R www-data:www-data *
|
|
fi
|
|
|
|
# Check if the lock file still exists.
|
|
if [ -f apt-panopticon.lock ] ; then
|
|
# Check if it's still running.
|
|
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
|
|
if [ -f apt-panopticon.running ] ; then
|
|
echo "Previous apt-panopticon still running, exiting."
|
|
rm apt-panopticon.running
|
|
exit 1
|
|
fi
|
|
echo "Crashed apt-panopticon detected, removing stale lock file."
|
|
rm apt-panopticon.lock
|
|
fi
|
|
|
|
rm ../results; ln -s apt-panopticon/results_old ../results
|
|
flock -n apt-panopticon.lock ./apt-panopticon.lua && rm apt-panopticon.lock
|
|
rm ../results; ln -s apt-panopticon/results ../results
|
|
|
|
chown -R www-data:www-data *
|
|
|