Permalink
Browse files

Allow disabling of NEMS automatic rolling updates in NEMS 1.5

  • Loading branch information...
NEMS Linux
NEMS Linux committed Nov 20, 2018
1 parent d68112a commit cdf3147f6b1ec23a1edfe63dd30263c52e4668e6
Showing with 33 additions and 14 deletions.
  1. +14 −0 info.sh
  2. +19 −14 quickfix.sh
14 info.sh
@@ -133,6 +133,20 @@ elif [[ $COMMAND == "username" ]]; then
fi
echo $username
elif [[ $COMMAND == "allowupdate" ]]; then
# See if we're allowed to run automated updates
# From nems.conf (set in NEMS SST)
if [[ -f /usr/local/share/nems/nems.conf ]]; then
if grep -q "allowupdate" /usr/local/share/nems/nems.conf; then
allowupdate=`cat /usr/local/share/nems/nems.conf | grep allowupdate | printf '%s' $(cut -n -d '=' -f 2)`
fi
fi
# Default is allow (if not set)
if [[ $allowupdate == "" ]]; then
allowupdate=1
fi
echo $allowupdate
# See current CPU usage in percent
@@ -1,20 +1,25 @@
#!/bin/bash
echo "Performing NEMS QuickFix..."
echo "It's really just a fancy name: this may take a while."
echo "Do not stop this script once it is running."
printf "Please wait patiently."
allowupdate=`/usr/local/bin/nems-info allowupdate`
if [[ $allowupdate == 1 ]]; then
echo "Performing NEMS QuickFix..."
echo "It's really just a fancy name: this may take a while."
echo "Do not stop this script once it is running."
printf "Please wait patiently."
for run in {1..2}
do
for run in {1..2}
do
printf "."
printf "."
# Create a copy of the update script to run
cp /usr/local/share/nems/nems-scripts/update.sh /tmp/qf.sh
# Create a copy of the update script to run
cp /usr/local/share/nems/nems-scripts/update.sh /tmp/qf.sh
# Run the copy
/tmp/qf.sh > /dev/null 2>&1
# Run the copy
/tmp/qf.sh > /dev/null 2>&1
done
rm /tmp/qf.sh
echo " Done."
done
rm /tmp/qf.sh
echo " Done."
else
echo "Updates are disabled in NEMS SST."
fi

0 comments on commit cdf3147

Please sign in to comment.