Gentoo Archives: gentoo-server

From: JD Gray <kahdgarxi@×××××.com>
To: gentoo-server@l.g.o
Subject: [gentoo-server] Scripting fun
Date: Tue, 10 Jun 2008 02:59:33
Message-Id: ac6df3680806091959k45435f27wd871ff7359d7e674@mail.gmail.com
1 I'm running the below script on my gentoo servers to email me whenever
2 there are GLSA's affecting me. It works like a charm, but I have one
3 beef with it. Newlines are not preserved, so I get a lovely Wall Of
4 Text (tm) when ever it sends me the GLSA. I'm guessing this is because
5 of the way bash handles variables. Anyone have any insight on how to
6 correct this?
7
8 #!/bin/bash
9
10 /usr/bin/glsa-check -t all &> /dev/null
11 CHECK_RESULT="`/usr/bin/glsa-check -t all 2>&1`"
12
13 if [ "$CHECK_RESULT" != "" ]; then
14 echo $CHECK_RESULT | /bin/mail -s "Frog glsa-check" kahdgarxi@×××××.com;
15 fi
16
17 Thanks in advance
18
19 -JD
20 --
21 gentoo-server@l.g.o mailing list

Replies

Subject Author
Re: [gentoo-server] Scripting fun RijilV <rijilv@×××××.com>
Re: [gentoo-server] Scripting fun "W.Kenworthy" <billk@×××××××××.au>
Re: [gentoo-server] Scripting fun Korthrun <korthrun@×××××.com>