I'm running the below script on my gentoo servers to email me whenever
there are GLSA's affecting me. It works like a charm, but I have one
beef with it. Newlines are not preserved, so I get a lovely Wall Of
Text (tm) when ever it sends me the GLSA. I'm guessing this is because
of the way bash handles variables. Anyone have any insight on how to
correct this?

#!/bin/bash

/usr/bin/glsa-check -t all &> /dev/null
CHECK_RESULT="`/usr/bin/glsa-check -t all 2>&1`"

if [ "$CHECK_RESULT" != "" ]; then
  echo $CHECK_RESULT | /bin/mail -s "Frog glsa-check" [EMAIL PROTECTED];
fi

Thanks in advance

-JD
-- 
gentoo-server@lists.gentoo.org mailing list

Reply via email to