On Mon, 2008-12-01 at 14:34 -0500, Greg Wooledge wrote:
> 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.
Right, but this probably should be something like:
#!/bin/sh
if ntfs-3g.probe /dev/sda1; then
echo "-fstype=ntfs-3g,other-opts :/dev/sda1"
else
echo "-fstype=vfat,other-opts :/dev/sda1"
fi
Ian
_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs