On Mon, Dec 01, 2008 at 12:03:27PM -0500, Jeff Moyer wrote:

> If that doesn't work, then I'd suggest a program map.  Something simple
> should work:
> 
> ---[cut here]---
> #!/bin/bash
> ntfs-3g.probe /dev/sda1
> if [ $? -eq 0 ]; then
>         ntfs-3g /dev/sda1 /media/$1
>         RET=$?
> else
>         mount -t vfat /dev/sda1 /media/$1
>         RET=$?
> fi
> 
> exit $RET
> ---[cut here]---

That can be simplified:

#!/bin/sh
if ntfs-3g.probe /dev/sda1; then
        ntfs-3g /dev/sda1 /media/"$1"
else
        mount -t vfat /dev/sda1 /media/"$1"
fi

The exit status of a script is the status from the last command which
was executed, so there's no need to save $? and then exit with it later.

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to