Joined: 01 Feb 2007 Posts: 138 Location: Wherever the boat takes me.
Posted: Fri Jun 23, 2017 14:14 Post subject:
To tell you the truth, I have not really looked at this script for years. The one I use now had this for the base, but has been changed many times. Right now, it does not work with the latest BusyBox and I don't have the time to play with it, so I just use a pre February revision of DD-WRT.
You could also remove this code since you are not checking and re-sending on a failed attempt:
Code:
if [ "$(cat $logfile | grep 221 | awk '{print $1}')" = "221" ]; then break;fi
and I get -sh: can't create : nonexistent directory
now if I run
cat /tmp/bwmsg.txt | sendmail <my to address> -S <my smtp> -f <my from address>
it works fine.
So I had to add <my to address> and remove the > $logfile 2>&1
I'm not really sure why though. If I edit custom.sh with those changes and try and run the whole thing from the CLI via ./custom.sh it never exits and keeps emailing me every two minutes. Any ideas on what's up with this script?
Sorry I have a bunch of projects on the go and won't be able to look at this anytime soon. Going back to the sendmail -d command, I guess you could typically write a code in your script to detect which version busybox is running the add the -d syntax if you are at a certain version. I have done this in some of my scripts in the past.
I could not figure out how to search a thread, so I apologize if this has already been discussed.
I found that my Kong build did not have the same implementation of date to determine yesterday's date, so I modified my script and it's working fine so far.
I changed my script to the following to allow using Julian date format:
My ISP is now requiring SSL and a user/pass. I've been using this script for a while now using port 25 and no auth. How can I modify it to connect to port 465 using SSL and pass the user/pass? Any help would be greatly appreciated.
I finally achieved sending with both TLS and user/pass working in the script. I added two new variables at the top called my_user and my_pass. I changed the sendmail line in the script to the following:
Is there a adaptation of this script that uploads the current days incoming and outgoing total traffic to a SQL database or something similar?
I would like to get the current days data every hour, replacing the current days with the new data until the next day, and upload the data to a SQL DB that is on the network.