![]() |
script help please - Printable Version +- ispCP - Board - Support (http://www.isp-control.net/forum) +-- Forum: ispCP Omega Development Area (/forum-1.html) +--- Forum: General discussion (/forum-11.html) +--- Thread: script help please (/thread-8436.html) |
script help please - ChrisJones - 11-14-2009 04:35 AM this is what i want to do... generate a greylist logfile for each domain , this is what the current manual command looks like. Code: cat /var/log/syslog | grep domain.co.uk |postgreyreport --nosingle_line --check_sender=mx,a --show_tries --separate_by_subnet=.:===============================================================================================\n. >/var/www/virtual/domain.co.uk/htdocs/postgrey.log i think a command something like this could work Code: cat /var/log/syslog | grep $domain |postgreyreport --nosingle_line --check_sender=mx,a --show_tries --separate_by_subnet=.:===============================================================================================\n. >/var/www/virtual/$domain/htdocs/postgrey.log the output really shouldnt be in a public folder unless protected. but im not very good at scripting tbh at the moment i currenly have a command that lists all domains. any help would be appreciated RE: script help please - Knut - 11-14-2009 03:53 PM short and untested: Code: #!/bin/bash Knut RE: script help please - ChrisJones - 11-15-2009 02:51 PM Thanks knut below is the final script which i called postgreylog , added a cron job to run before syslog has been cleared. Not all systems have mail logging in syslog so customise as required. Changed where the file is saved a little , might be interesting to get something like this into the users control panel so they can check to see if real mail is being blocked (my wife had 5 email addresses today). had to change it just a little but overall it does it's job. Thanks for helping to run script past into your most used editor and save , then chmod +x it. run to test. sample output here Code: #!/bin/bash Thanks Chris Jones RE: script help please - Knut - 11-15-2009 03:27 PM Hi, you can change the line Code: if test -d /var/www/virtual/$domain/htdocs; then Code: if test -d $output$domain/htdocs; then Knut RE: script help please - ChrisJones - 11-16-2009 09:59 PM yeah saw that not too long after , but it was early in the morning for me ![]() RE: script help please - Knut - 11-16-2009 10:02 PM You know the usermap ? http://www.isp-control.net/forum/usermap.php :-) Knut RE: script help please - ChrisJones - 11-16-2009 10:37 PM lol look at the top bubble for uk ,slightly out of place but only a little |