Whoa!
I can read this code. Is this Perl?
Thanks for the help Tony, James and Jeff.
Stu
James wrote:
>
> if (system($mountcmd)) {
> die "couldn't mount stuff";
> }
>
> # other stuff here.
>
> or if you want retries you could use something like this:
>
> my ($retries, $maxretries) = (0, 5);
> my $returncode;
>
> while ($returncode = system($mountcmd) && $retries++ < $maxretries) {
> print stderr "I'm broken\n";
> sleep 30;
> }
>
> if ($returncode) {
> die "couldn't mount stuff";
> }
>
> # other stuff here.
>
> the thing to remember about return codes is that they're 0 when it has
> succeeded, not when it has failed.
>
> disclaimer: all code untested but it looks approximately right.
>
> HTH
>
> James.
>
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug