Skip to content
Snippets Groups Projects
Commit 3ac7a67a authored by Ruben Rodriguez's avatar Ruben Rodriguez
Browse files

Improve lock logic

parent ae782756
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
cd /home/ubuntu cd /home/ubuntu
set -e set -e
if [ -e LOCK ]; then
echo "Lock file found, aborting run."
exit 1
fi
echo Started on $(date) echo Started on $(date)
echo Self updating from git... echo Self updating from git...
...@@ -28,10 +33,11 @@ repexit(){ ...@@ -28,10 +33,11 @@ repexit(){
echo WARNING: reprepro ended unexpectedly echo WARNING: reprepro ended unexpectedly
echo Do NOT update any leaf repositories from here until it is fixed echo Do NOT update any leaf repositories from here until it is fixed
echo "Error during update at $(date)" > ERROR echo "Error during update at $(date)" > ERROR
rm -f LOCK
exit 1 exit 1
} }
echo "Locking during repo update at $(date)" > ERROR echo "Locking for repo update at $(date)" > LOCK
echo Updating ubuntu mirrors... echo Updating ubuntu mirrors...
reprepro --noskipold -v -b . predelete || repexit reprepro --noskipold -v -b . predelete || repexit
...@@ -42,6 +48,6 @@ sh purge.sh xenial flidas ...@@ -42,6 +48,6 @@ sh purge.sh xenial flidas
sh purge.sh bionic etiona sh purge.sh bionic etiona
sh purge.sh focal nabia sh purge.sh focal nabia
rm ERROR -f rm ERROR LOCK -f
echo DONE at $(date) echo DONE at $(date)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment