Skip to content

Commit

Permalink
Improve detection of running updates
Browse files Browse the repository at this point in the history
  • Loading branch information
NEMS Linux committed Feb 8, 2019
1 parent 4fe6464 commit c75b12f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
20 changes: 14 additions & 6 deletions quickfix.sh
@@ -1,12 +1,18 @@
#!/bin/bash
allowupdate=`/usr/local/bin/nems-info allowupdate`

quickfix=$(/usr/local/bin/nems-info quickfix)
if [[ $quickfix == 1 ]]; then
echo 'Already running.'
exit
fi
echo $$ > /var/run/nems-quickfix.pid

# Just in case nems-quickfix is running
quickfix=$(/usr/local/bin/nems-info quickfix)
if [[ $quickfix == 1 ]]; then
echo 'NEMS Linux is currently updating itself. Please wait...'
while [[ $quickfix == 1 ]]
do
sleep 1
quickfix=$(/usr/local/bin/nems-info quickfix)
done
fi
echo $$ > /var/run/nems-quickfix.pid

# 1 = Not allowed
# 2 = Allowed monthly
Expand Down Expand Up @@ -63,3 +69,5 @@ if [[ $proceed == 1 ]]; then
else
echo "Update Skipped based on settings in NEMS SST."
fi

rm -f /var/run/nems-quickfix.pid
3 changes: 3 additions & 0 deletions update.sh
Expand Up @@ -26,6 +26,7 @@ else
quickfix=$(/usr/local/bin/nems-info quickfix)
done
fi
echo $$ > /var/run/nems-quickfix.pid

# Update nems-migrator
printf "Updating nems-migrator... "
Expand Down Expand Up @@ -178,3 +179,5 @@ else

fi
echo ""

rm -f /var/run/nems-quickfix.pid

0 comments on commit c75b12f

Please sign in to comment.