Code Sample |
#!/bin/sh MNTPNT=/mnt/hda5 # mount point DOCDIR="$MNTPNT/MyDocuments" # name of linked directory # name of the link will be generated from DOCDIR basename mount_fail() { echo "$MNTPNT failure - exiting" exit 1 } mount $MNTPNT && echo "$MNTPNT mounted" || mount_fail [ -d "$DOCDIR" ] || mkdir -p "$DOCDIR" ln -s "$DOCDIR" "$HOME/`basename $DOCDIR`" |