What I want to do is run something at Agency so when new files land in my inbound a .sh script is run and tests are performed such that if it's a Galactic Dynasty file then the script runs GD maint, if it's a For Honour file it runs FH maint etc.. you get the idea.
What I want to do is run something at Agency so when new files land in
my inbound a .sh script is run and tests are performed such that if
it's a Galactic Dynasty file then the script runs GD maint, if it's a
For Honour file it runs FH maint etc.. you get the idea.
Are there any specific filename patterns which can be detected for each
of those?
That's easy. Just something like this in your binkd.config will the
trick.
exec "/pathtoscript/maint.sh" /husky/inbound.sec/*.[gG][aA][lL]
Are there any specific filename patterns which can be detected for ea of those?
Yes I want one script to run then check for *.GAL files and if found in
my inbound then run the GD maint
I'd like to add additional such tests to the script so it tests for *.FHR files and runs For Honour etc :)
On 01 Aug 2021 at 07:21p, Vorlon pondered and said...
That's easy. Just something like this in your binkd.config will the
trick.
exec "/pathtoscript/maint.sh" /husky/inbound.sec/*.[gG][aA][lL]
If BinkD were getting the files, I agree, but in this case it's the Mystic BinkP server at Agency getting them from a BinkD system. So at the moment
I have it so a sh file runs on each inbound toss and then I just want to sort the logic so it tests and runs correct door maint first before it
then hands back to Mystic and Mystic starts running MUTIL to import messages etc.
exec "/pathtoscript/maint.sh" /husky/inbound.sec/*.[gG][aA][lL]
If BinkD were getting the files, I agree, but in this case it's the
Mystic BinkP server at Agency getting them from a BinkD system. So at
the moment I have it so a sh file runs on each inbound toss and then I just want to sort the logic so it tests and runs correct door maint
first before it then hands back to Mystic and Mystic starts running
MUTIL to import messages etc.
The same process can be used.. just slightly different... You would need to create a mail
processing script that mystic uses instead of having the commands in the event.
if [ -f /inbound/*.GAL ]
process the gal file(s)
fi
Hello Avon!
On 06 Aug 2021 at 12:30p, Zip pondered and said...
Hello Avon!
Thank you for this. I'm trying at moment to just script a basic .sh file
to call from Mystic events
#!/bin/bash
# check for and process incoming door files if found
cd /bbs/mystic/echomail/in
if [ -f /bbs/mystic/echomail/in/*.GAL ]
cd /bbs/doors/gd
/GalacticDynasty maintenance;
fi
but this errors.. says something like syntax error near unexpected token 'fi'
#!/bin/bash
# check for and process incoming door files if found
cd /bbs/mystic/echomail/in
if [ -f /bbs/mystic/echomail/in/*.GAL ]
cd /bbs/doors/gd
./GalacticDynasty maintenance;
fi
instead of having the commands in the event.
if [ -f /inbound/*.GAL ]
process the gal file(s)
fi
Can I then add multiple lines in the same .sh and know all if
statements will be tested on each occasion the .sh is run? Or does it
end the .sh once it runs once and ends on a fi ?
Ah, you have a missing "then" after the if.
Just in case you need some local timezone support, I'm happy to help you out with bash scripting if needs be. I'm an old-time Linux sysadmin from years ago, but shell scripting is like riding a bike (I only fall off every now and then!)
Thanks Al.
It's new for me as I've been using .bat files for many years... :)
#!/bin/bash
if [ ! -z "$(find /bbs/mystic/echomail/in/ -xdev -mindepth 1 -maxdepth 1 -type f -iname '*.GAL' -print -quit)" ]
then
cd /bbs/doors/gd || { echo "ERROR: Could not switch to GD directory! " >&2; exit 1; }
./GalacticDynasty maintenance
fi
thanks this is working :)
I have been letting it run on auto pilot the last few days and run as a .sh each time an incoming packets is detected by mystic.
If I were to add a similar section to the same .sh but get it testing
for For Honour packets can I do that without issue? In a bat file after one section of the .bat is executed it may move to the :done section and exit so just checking if I need multiple .sh or ?
Sysop: | altere |
---|---|
Location: | Houston, TX |
Users: | 66 |
Nodes: | 4 (0 / 4) |
Uptime: | 12:10:51 |
Calls: | 728 |
Files: | 7,667 |
Messages: | 295,560 |