Subj : Re: Basic script help To : Avon From : Zip Date : Sat Aug 14 2021 10:24 am Hello Avon! On 14 Aug 2021, Avon said the following... Av> thanks this is working :) You're very welcome! Av> I have been letting it run on auto pilot the last few days and run as a Av> .sh each time an incoming packets is detected by mystic. Sounds great! Av> If I were to add a similar section to the same .sh but get it testing Av> for For Honour packets can I do that without issue? In a bat file after Av> one section of the .bat is executed it may move to the :done section and Av> exit so just checking if I need multiple .sh or ? There are no goto labels in shell scripts, but you can add another block of "checks/actions" (the entire if clause) after the first one, for FH. You will have to decide how to handle errors from each block, though. Should the second block run if the first one failed? (Probably.) Although cron will not care about exit status (but will report stdout and stderr output messages to you via mail), you might want to "collect" the status anyway and exit with status 0 (OK) if all was OK, and something not 0 if anything went wrong, for good measure. Something like: #!/bin/bash ERRORS_DETECTED=0 if [ ! -z "$(find /bbs/mystic/echomail/in/ -xdev -mindepth 1 -maxdept -type f -iname '*.GAL' -print -quit)" ] then cd /bbs/doors/gd if [ $? -eq 0 ] then ./GalacticDynasty maintenance RC=$? if [ $RC -ne 0 ] then echo "ERROR: Non-zero exit code ($RC) from GD maintenance! " >&2 ERRORS_DETECTED=1 fi else echo "ERROR: Could not switch to GD directory! " >&2 ERRORS_DETECTED=1 fi fi if [ ! -z "$(find /bbs/mystic/echomail/in/ -xdev -mindepth 1 -maxdept -type f -iname '*.FHR' -print -quit)" ] then cd /bbs/doors/fh if [ $? -eq 0 ] then ./ForHonour maintenance RC=$? if [ $RC -ne 0 ] then echo "ERROR: Non-zero exit code ($RC) from FH maintenance! " >&2 ERRORS_DETECTED=1 fi else echo "ERROR: Could not switch to FH directory! " >&2 ERRORS_DETECTED=1 fi fi if [ $ERRORS_DETECTED -ne 0 ] then echo "ERROR: One or more errors detected! " >&2 exit 1 fi exit 0 If you were wondering about the space after ! in the echo statements, ! is some kind of event/histort operator and bash will try to find an event named like whatever non-whitespace that follows !, and adding a space after ! solves this. Should only make a difference when copying and pasting things to the command line, though... But doesn't hurt even in the scripts. (Apart from that you get that extra space in the output.) Hope this helps. :) Best regards Zip --- Mystic BBS v1.12 A47 2021/08/08 (Linux/64) * Origin: Star Collision BBS, Uppsala, Sweden (21:1/202) .