From 73c57e5034e63802d6c3321bedaf8ca1b03fb768 Mon Sep 17 00:00:00 2001 From: Mark McIntyre Date: Tue, 14 Sep 2021 21:48:54 +0100 Subject: [PATCH 1/5] do not remove reboot lock file too soon --- ukmonPostProc.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ukmonPostProc.py b/ukmonPostProc.py index 7ba4325..4ca2505 100644 --- a/ukmonPostProc.py +++ b/ukmonPostProc.py @@ -125,8 +125,8 @@ def rmsExternal(cap_dir, arch_dir, config): uploadToArchive.uploadToArchive(arch_dir, log) - os.remove(rebootlockfile) - + # do not remote reboot lock file if running another script + # os.remove(rebootlockfile) try: with open(os.path.join(myloc, 'extrascript'),'r') as extraf: extrascript=extraf.readline().strip() From 1105c79bc4d7536115778af839c346e80eea8d39 Mon Sep 17 00:00:00 2001 From: Mark McIntyre Date: Tue, 14 Sep 2021 21:49:11 +0100 Subject: [PATCH 2/5] create dummy ukmon.ini file if not present --- refreshTools.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/refreshTools.sh b/refreshTools.sh index 5c77b75..097e033 100755 --- a/refreshTools.sh +++ b/refreshTools.sh @@ -56,6 +56,12 @@ else echo "" read -p "Press any key to continue" fi + if [ ! -f $here/ukmon.ini ] ; then + echo "# config data for this station" > $here/ukmon.ini + echo "export LOCATION=NOTCONFIGURED" >> $here/ukmon.ini + echo "export UKMONHELPER=3.8.65.98" >> $here/ukmon.ini + echo "export UKMONKEY=~/.ssh/ukmon" >> $here/ukmon.ini + fi fi if [ $(grep ukmonPost ~/source/RMS/.config | wc -l) -eq 0 ] ; then python -c 'import ukmonPostProc as pp ; pp.installUkmonFeed();' From 84f77bebdc0ba99853e78dc91c15631ceee2459b Mon Sep 17 00:00:00 2001 From: Mark McIntyre Date: Tue, 14 Sep 2021 21:53:23 +0100 Subject: [PATCH 3/5] ensure a default ini file exists --- refreshTools.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/refreshTools.sh b/refreshTools.sh index 097e033..9f5ed31 100755 --- a/refreshTools.sh +++ b/refreshTools.sh @@ -56,13 +56,15 @@ else echo "" read -p "Press any key to continue" fi - if [ ! -f $here/ukmon.ini ] ; then - echo "# config data for this station" > $here/ukmon.ini - echo "export LOCATION=NOTCONFIGURED" >> $here/ukmon.ini - echo "export UKMONHELPER=3.8.65.98" >> $here/ukmon.ini - echo "export UKMONKEY=~/.ssh/ukmon" >> $here/ukmon.ini - fi fi + +if [ ! -f $here/ukmon.ini ] ; then + echo "# config data for this station" > $here/ukmon.ini + echo "export LOCATION=NOTCONFIGURED" >> $here/ukmon.ini + echo "export UKMONHELPER=3.8.65.98" >> $here/ukmon.ini + echo "export UKMONKEY=~/.ssh/ukmon" >> $here/ukmon.ini +fi + if [ $(grep ukmonPost ~/source/RMS/.config | wc -l) -eq 0 ] ; then python -c 'import ukmonPostProc as pp ; pp.installUkmonFeed();' fi From 751d8216ac557e0aa811ded2d9cbfa40451cb3ce Mon Sep 17 00:00:00 2001 From: Mark McIntyre Date: Tue, 14 Sep 2021 21:55:09 +0100 Subject: [PATCH 4/5] bugfix --- refreshTools.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/refreshTools.sh b/refreshTools.sh index 9f5ed31..7b01593 100755 --- a/refreshTools.sh +++ b/refreshTools.sh @@ -12,6 +12,13 @@ git stash git pull git stash apply +if [ ! -f $here/ukmon.ini ] ; then + echo "# config data for this station" > $here/ukmon.ini + echo "export LOCATION=NOTCONFIGURED" >> $here/ukmon.ini + echo "export UKMONHELPER=3.8.65.98" >> $here/ukmon.ini + echo "export UKMONKEY=~/.ssh/ukmon" >> $here/ukmon.ini +fi + if [ -f $here/.firstrun ] ; then if [[ "$LOCATION" != "NOTCONFIGURED" && "$LOCATION" != "" ]] ; then if [ $(file $here/ukmon.ini | grep CRLF | wc -l) -ne 0 ] ; then @@ -58,13 +65,6 @@ else fi fi -if [ ! -f $here/ukmon.ini ] ; then - echo "# config data for this station" > $here/ukmon.ini - echo "export LOCATION=NOTCONFIGURED" >> $here/ukmon.ini - echo "export UKMONHELPER=3.8.65.98" >> $here/ukmon.ini - echo "export UKMONKEY=~/.ssh/ukmon" >> $here/ukmon.ini -fi - if [ $(grep ukmonPost ~/source/RMS/.config | wc -l) -eq 0 ] ; then python -c 'import ukmonPostProc as pp ; pp.installUkmonFeed();' fi From 70226195e3891bdd6d8dc961db5a32272a21d1c5 Mon Sep 17 00:00:00 2001 From: Mark McIntyre Date: Tue, 14 Sep 2021 21:58:20 +0100 Subject: [PATCH 5/5] ignore ukmon.ini --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index dfa2cfe..adddbaf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ domp4s extrascript dotimelapse .config.backup +ukmon.ini # Byte-compiled / optimized / DLL files __pycache__/