~ubuntu-branches/ubuntu/karmic/ltspfs/karmic

« back to all changes in this revision

Viewing changes to scripts/remove_fstab_entry

  • Committer: Bazaar Package Importer
  • Author(s): Scott Balneaves
  • Date: 2006-09-18 13:01:06 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060918130106-ns6gmg2kl0oic3h6
Tags: 0.4.3-0ubuntu1
* Fixed variable check for static-devices in add_fstab_entry
* Bumped to 0.4.3
* UVF exception granted by mdz

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# remove_fstab_entry
 
3
# place in /lib/udev
 
4
 
 
5
grep ${1} /etc/fstab | while read DEV MOUNTPOINT TYPE OPTIONS DUMP PASS; do
 
6
    umount -l ${DEV} 2>&1 >/dev/null
 
7
    rmdir ${MOUNTPOINT}
 
8
    if [ -S /tmp/.ltspfs-socket ]; then
 
9
            /usr/bin/ssh -S /tmp/.ltspfs-socket server \
 
10
                     "/usr/sbin/ltspfsmounter $MOUNTPOINT remove"
 
11
    else
 
12
        # use \| as separator for sed because path uses /
 
13
        sed -i -e "\|${MOUNTPOINT}|d" /var/run/.delayed-mount
 
14
        # Check and see if the file's now empty.  If it is, remove it.
 
15
        if [ ! -s /var/run/.delayed-mount ]; then
 
16
            rm /var/run/.delayed-mount
 
17
        fi
 
18
    fi
 
19
done
 
20
 
 
21
sed -e "/^\/dev\/$1 /d" /etc/fstab >/tmp/fstab
 
22
cp /tmp/fstab /etc/
 
23
rm /tmp/fstab