From 66dd1232ff58cd777613f33c8f00403fe341a599 Mon Sep 17 00:00:00 2001 From: Steve Magnuson Date: Thu, 12 Dec 2019 10:37:46 -0800 Subject: [PATCH] Added check to see if fldigi is running --- hampi-utilities.version | 2 +- trim-fldigi-log.sh | 10 ++++++---- trim-flmsg-log.sh | 6 ++++-- trim-flrig-log.sh | 8 +++++--- trim-fsq-audit.sh | 9 +++++---- trim-fsq-heard.sh | 9 +++++---- 6 files changed, 26 insertions(+), 18 deletions(-) diff --git a/hampi-utilities.version b/hampi-utilities.version index 19ff91e..2f5d92d 100644 --- a/hampi-utilities.version +++ b/hampi-utilities.version @@ -1 +1 @@ -VERSION="1.8.1" \ No newline at end of file +VERSION="1.8.2" \ No newline at end of file diff --git a/trim-fldigi-log.sh b/trim-fldigi-log.sh index b8b7510..d5680a3 100755 --- a/trim-fldigi-log.sh +++ b/trim-fldigi-log.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="1.4" +VERSION="1.5" # # This script removes log files from the $HOME/.fldigi* folder(s) and subfolders. @@ -10,8 +10,7 @@ VERSION="1.4" # # Parameter 1 is a date reference e.g. "10 days ago" or "1 hour ago" # -# DO NOT run this script while Fldigi is running. Likewise, -# DO NOT run this script using Fldigi's autostart feature. It must be run +# This script will not run if Fldigi is running. It must be run # prior to starting Fldigi. If you want to run it every time you start # Fldigi on a Raspberry Pi, change the File Properties # of the Fldigi menu item to run this script and then Fldigi as follows: @@ -21,11 +20,14 @@ VERSION="1.4" # In the Command field, replace 'fldigi' with the following (change the # time period as desired): # -# sh -c '/usr/local/bin/trim-fldigi-log.sh "1 week ago"';fldigi +# sh -c '/usr/local/bin/trim-fldigi-log.sh "1 week ago"';fldigi ... # # Leave the "Execute in Terminal" box unchecked, then click OK. # +# Exit if Fldigi is already running +pgrep fldigi >/dev/null && exit 0 + DIRS="$HOME/.fldigi $HOME/.fldigi-left $HOME/.fldigi-right" # Some error checking diff --git a/trim-flmsg-log.sh b/trim-flmsg-log.sh index ff3c858..af86a76 100755 --- a/trim-flmsg-log.sh +++ b/trim-flmsg-log.sh @@ -9,7 +9,7 @@ VERSION="1.5" # # Parameter 1 is a date reference e.g. "10 days ago" or "1 hour ago" # -# DO NOT run this script while Flmsg is running. It must be run +# This script will not run if Flmsg is running. It must be run # prior to starting Flmsg. If you want to run it every time you start # Flmsg on a Raspberry Pi, change the File Properties # of the Flmsg menu item to run this script and then Flmsg as follows: @@ -19,11 +19,13 @@ VERSION="1.5" # In the Command field, replace 'flmsg' with the following (change the # time period as desired): # -# sh -c '/usr/local/bin/trim-flmsg-log.sh "1 week ago"';flmsg +# sh -c '/usr/local/bin/trim-flmsg-log.sh "1 week ago"';flmsg ... # # Leave the "Execute in Terminal" box unchecked, then click OK. # +# Exit if Flmsg is already running +pgrep flmsg >/dev/null && exit 0 DIRS="$HOME/.nbems $HOME/.nbems-left $HOME/.nbems-right" SDIRS="/log_files/* /temp_files/* /ICS/*.htm /ICS/*.csv /ICS/messages/* /ICS/messages/archive/* /ICS/log_files/* /WRAP/auto/* /WRAP/recv/* /WRAP/send/* /TRANSFERS/* /FLAMP/*log* /FLAMP/rx/* /FLAMP/tx/* /ARQ/files/* /ARQ/mail/* /ARQ/recv/* /ARQ/send/*" diff --git a/trim-flrig-log.sh b/trim-flrig-log.sh index 545eb22..6150289 100755 --- a/trim-flrig-log.sh +++ b/trim-flrig-log.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="1.4" +VERSION="1.5" # This script removes log files from the $HOME/.flrig* folder(s) and subfolders. # Files with "last modified" timestamps that are before the specified time @@ -9,7 +9,7 @@ VERSION="1.4" # # Parameter 1 is a date reference e.g. "10 days ago" or "1 hour ago" # -# DO NOT run this script while Flrig is running. It must be run +# This script will not run if Flrig is running. It must be run # prior to starting Flrig. If you want to run it every time you start # Flrig on a Raspberry Pi, change the File Properties # of the Flrig menu item to run this script and then Flrig as follows: @@ -19,11 +19,13 @@ VERSION="1.4" # In the Command field, replace 'flrig' with the following (change the # time period as desired): # -# sh -c '/usr/local/bin/trim-flrig-log.sh "1 week ago"';flrig +# sh -c '/usr/local/bin/trim-flrig-log.sh "1 week ago"';flrig ... # # Leave the "Execute in Terminal" box unchecked, then click OK. # +# Exit if Fldigi is already running +pgrep flrig >/dev/null && exit 0 DIRS="$HOME/.flrig $HOME/.flrig-left $HOME/.flrig-right" diff --git a/trim-fsq-audit.sh b/trim-fsq-audit.sh index dbe3d73..20c8232 100755 --- a/trim-fsq-audit.sh +++ b/trim-fsq-audit.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="1.4" +VERSION="1.5" # This script trims the fsq_audit_log.txt file # in the ~/.fldigi/temp folder by removing content added aded earlier @@ -8,8 +8,7 @@ VERSION="1.4" # # Parameter 1 is a date reference e.g. "10 days ago" or "1 hour ago" # -# DO NOT run this script while Fldigi is running. Likewise, -# DO NOT run this script using Fldigi's autostart feature. It must be run +# This script will not run if Fldigi is running. It must be run # prior to starting Fldigi. If you want to run it every time you start # Fldigi on a Raspberry Pi, change the File Properties # of the Fldigi menu item to run this script and then Fldigi as follows: @@ -19,7 +18,7 @@ VERSION="1.4" # In the Command field, replace 'fldigi' with the following (change the # time period as desired): # -# sh -c '/usr/local/bin/trim-fsq-audit.sh "30 days ago"';fldigi +# sh -c '/usr/local/bin/trim-fsq-audit.sh "30 days ago"';fldigi ... # # Leave the "Execute in terminal" box unchecked, then click OK. # @@ -30,6 +29,8 @@ VERSION="1.4" # sh -c '/usr/local/bin/trim-fsq-audit.sh "30 days ago";/usr/local/bin/trim-fsq-heard.sh "1 hour ago"';fldigi # +# Exit if Fldigi is already running +pgrep fldigi >/dev/null && exit 0 DIRS="$HOME/.fldigi/temp $HOME/.fldigi-left/temp $HOME/.fldigi-right/temp" diff --git a/trim-fsq-heard.sh b/trim-fsq-heard.sh index 8004ea6..2e57fed 100755 --- a/trim-fsq-heard.sh +++ b/trim-fsq-heard.sh @@ -1,6 +1,6 @@ #!/bin/bash -VERSION="1.4" +VERSION="1.5" # This script trims the fsq_heard_log.txt file # in the ~/.fldigi/temp folder by removing lines with timestamps earlier @@ -8,8 +8,7 @@ VERSION="1.4" # # Parameter 1 is a date reference e.g. "10 days ago" or "1 hour ago" # -# DO NOT run this script while Fldigi is running. Likewise, -# DO NOT run this script using Fldigi's autostart feature. It must be run +# This script will not run if Fldigi is running. It must be run # prior to starting Fldigi. If you want to run it every time you start # Fldigi on a Raspberry Pi, change the File Properties # of the Fldigi menu item to run this script and then Fldigi as follows: @@ -19,7 +18,7 @@ VERSION="1.4" # In the Command field, replace 'fldigi' with the following (change the # time period as desired): # -# sh -c '/home/pi/trim-fsq-heard.sh "1 week ago"';fldigi +# sh -c '/home/pi/trim-fsq-heard.sh "1 week ago"';fldigi ... # # Leave the "Execute in Terminal" box unchecked, then click OK. # @@ -30,6 +29,8 @@ VERSION="1.4" # sh -c '/usr/local/bin/trim-fsq-audit.sh "30 days ago";/usr/local/bin/trim-fsq-heard.sh "1 week ago"';fldigi # +# Exit if Fldigi is already running +pgrep fldigi >/dev/null && exit 0 DIRS="$HOME/.fldigi/temp $HOME/.fldigi-left/temp $HOME/.fldigi-right/temp"