What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
For example, if I have a script that receives an email and reports a status because of it? I know that I could hard-code everything, but that's tacky. :-)
Thanks, Jon
Execute this line at the beginning of your script:
. $BBHOME/etc/bbdef.sh
Make sure you have the period<space> at the beginning.
Jim Smith
SVHS
From: Jon Boede [mailto:jon at shadowsoft.com] Sent: Monday, October 06, 2008 10:57 AM To: hobbit at hswn.dk Subject: [hobbit] BB environment variables
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
For example, if I have a script that receives an email and reports a status because of it? I know that I could hard-code everything, but that's tacky. :-)
Thanks, Jon
I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(
Smith, Jim wrote:
*Execute this line at the beginning of your script:*
*. $BBHOME/etc/bbdef.sh*
*Make sure you have the period<space> at the beginning.*
*Jim Smith*
*SVHS*
*From:* Jon Boede [mailto:jon at shadowsoft.com] *Sent:* Monday, October 06, 2008 10:57 AM *To:* hobbit at hswn.dk *Subject:* [hobbit] BB environment variables
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
For example, if I have a script that receives an email and reports a status because of it? I know that I could hard-code everything, but that's tacky. :-)
Thanks, Jon
Try using $BBHOME/etc/hobbitserver.cfg .
Thanks, Larry Barber
On Mon, Oct 6, 2008 at 11:18 AM, Jon Boede <jon at shadowsoft.com> wrote:
I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(
Smith, Jim wrote:
*Execute this line at the beginning of your script:*
*. $BBHOME/etc/bbdef.sh*
*Make sure you have the period<space> at the beginning.*
*Jim Smith*
*SVHS*
*From:* Jon Boede [mailto:jon at shadowsoft.com <jon at shadowsoft.com>] *Sent:* Monday, October 06, 2008 10:57 AM *To:* hobbit at hswn.dk *Subject:* [hobbit] BB environment variables
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
For example, if I have a script that receives an email and reports a status because of it? I know that I could hard-code everything, but that's tacky. :-)
Thanks, Jon
Sorry...I was thinking about Big Brother clients.
For Hobbit, you should call your script from "server/etc/ hobbitlaunch.cfg".
I have one like this:
[lvm]
ENVFILE /home/hobbit/server/etc/hobbitserver.cfg
NEEDS hobbitd
CMD $BBHOME/ext/bb-lvm.sh
LOGFILE $BBSERVERLOGS/bb-lvm.log
INTERVAL 15m
Jim Smith
From: Jon Boede [mailto:jon at shadowsoft.com] Sent: Monday, October 06, 2008 11:18 AM To: hobbit at hswn.dk Subject: Re: [hobbit] BB environment variables
I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(
Smith, Jim wrote:
Execute this line at the beginning of your script:
. $BBHOME/etc/bbdef.sh
Make sure you have the period<space> at the beginning.
Jim Smith
SVHS
From: Jon Boede [mailto:jon at shadowsoft.com] Sent: Monday, October 06, 2008 10:57 AM To: hobbit at hswn.dk Subject: [hobbit] BB environment variables
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
For example, if I have a script that receives an email and reports a status because of it? I know that I could hard-code everything, but that's tacky. :-)
Thanks, Jon
Jon Boede wrote:
I don't have a bbdef.sh anywhere under my hobbit ~/server directory... :-(
Smith, Jim wrote:
*Execute this line at the beginning of your script:*
*. $BBHOME/etc/bbdef.sh*
*Make sure you have the period<space> at the beginning.*
*Jim Smith*
*SVHS*
Try hobbitserver.cfg
--
Rich Smrcina VM Assist, Inc. Phone: 414-491-6001 Ans Service: 360-715-2467 rich.smrcina at vmassist.com http://www.linkedin.com/in/richsmrcina
Catch the WAVV! http://www.wavv.org WAVV 2009 - Orlando, FL - May 15-19, 2009
On Monday 06 October 2008, Jon Boede wrote:
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
For example, if I have a script that receives an email and reports a status because of it? I know that I could hard-code everything, but that's tacky. :-) server/bin/bbcmd <your script>
And if that gives an error that it can not open a config file, first do export BBHOME=<server dir>
This also works for the hobbit client.
Stef
In <48EA3536.9090302 at shadowsoft.com> jon at shadowsoft.com (Jon Boede) writes:
What's a good way to get all the BB environment variables set up when I want to use them in a script that's not launched from hobbitd?
Put "bbcmd" in front of your command. I.e. run
bbcmd /home/jon/myscript.sh
Forget everything about using "bbdef.sh" (that's for Big Brother), or source'ing hobbitserver.cfg directly - bbcmd is *the* way to have the Hobbit environment available.
Henrik
participants (6)
-
henrik@hswn.dk
-
JMSmith@stvincenthealth.com
-
jon@shadowsoft.com
-
lebarber@gmail.com
-
rsmrcina@wi.rr.com
-
stef.coene@docum.org