Permalink
Browse files

Wait for updates

  • Loading branch information...
NEMS Linux
NEMS Linux committed Feb 6, 2019
1 parent aae0fd5 commit 63e1bde2ef00d72c18bf66f635041ae6722b1573
Showing with 32 additions and 0 deletions.
  1. +14 −0 info.sh
  2. +7 −0 quickfix.sh
  3. +11 −0 upgrade.sh
14 info.sh
@@ -333,6 +333,20 @@ elif [[ $COMMAND == "webhook" ]]; then
fi
echo $webhook

elif [[ $COMMAND == "quickfix" ]]; then
if [[ -e /var/run/nems-quickfix.pid ]]; then
pid=$(cat /var/run/nems-quickfix.pid)
if ps -p $pid > /dev/null
then
echo 1
else
echo 0
fi
else
echo 0
fi


# Output usage info as no valid command line argument was provided
else
echo "Usage: ./$me command"
@@ -1,6 +1,13 @@
#!/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

# 1 = Not allowed
# 2 = Allowed monthly
# 3 = Allowed semi-weekly
@@ -20,6 +20,17 @@ else
echo "Done."
# ----------------------------------

# 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


# ensure /boot won't run out of space
diskfree=$(($(stat -f --format="%a*%S" /boot)))

0 comments on commit 63e1bde

Please sign in to comment.