Make the script check if it's running interactively, and if not, set
the environment variables you need.
On Sep 24, 2007, at 2:04 PM, Burton Windle wrote:
> So I've got a shell script that I want the output to be available
> as a internal-only web page. The shell script is fairly intensive,
> so I'd like it ran only when needed (i.e., not pre-generated).
> However, the shell script calls a compiled program that is
> expecting certian enviromental variables to be set (like, HOME,
> etc) that doesn't get done when run as www-data (which is what
> Debian runs Apache as).
> Right now my "web page" is simply:
> $cmd = shell_exec('/home/bwindle/find-ASA-vpn-users.sh');
> echo "<pre>$cmd";
> What's a clean way to do this?
> Burton Windle [log in to unmask]