Permalink
Browse files

Improve detection of running updates

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 8, 2019
1 parent 4fe6464 commit c75b12f3db7f41e83f1265034d008b2f0dbc8f71
Showing with 17 additions and 6 deletions.
  1. +14 −6 quickfix.sh
  2. +3 −0 update.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
@@ -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
@@ -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... "
@@ -178,3 +179,5 @@ else

fi
echo ""

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

0 comments on commit c75b12f

Please sign in to comment.