-------------------------------------------------- From: "Nadeem M. Khan" nadeem.m.khan@gmail.com Sent: Monday, November 22, 2010 9:47 AM To: "GNU/Linux Users Group, Mumbai, India" linuxers@mm.ilug-bom.org.in Subject: Re: [ILUG-BOM] running script only if USB is mounted
On Mon, Nov 22, 2010 at 7:49 AM, Binand Sethumadhavan binand@gmail.com wrote:
All mounted filesystems have an entry in /proc/mounts. Your script can take advantage of this.
if ! grep -q /backup /proc/mounts; then if ! mount -t ext3 /dev/sdb1 /backup; then exit 1; # Mount failed, bail out fi fi
another non-portable way of checking it is df -l.
Regards, NMK. -- http://mm.glug-bom.org/mailman/listinfo/linuxers
Thank you Nadeem, will check out this script and revert in case of it not working, etc.
Regards Kshitiz