X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_sbin%2Fprepare_tmpfs.sh;h=5be00579f0fc4b73d23a003ff2f95b7b9a42cae2;hb=e0a12bd3e2415e73e0a49c7df264cef1786daca1;hp=4b393f2fe7e993c31020ed023c78b52c4610dfa9;hpb=e720deae78f1eda5e6f62629606c194f16796762;p=grml-scripts.git diff --git a/usr_sbin/prepare_tmpfs.sh b/usr_sbin/prepare_tmpfs.sh index 4b393f2..5be0057 100755 --- a/usr_sbin/prepare_tmpfs.sh +++ b/usr_sbin/prepare_tmpfs.sh @@ -1,10 +1,10 @@ #!/bin/zsh # Filename: prepare_tmpfs.sh -# Purpose: setup a tmpfs +# Purpose: set up a tmpfs of a selected directory # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Mai 27 15:13:03 CEST 2006 [mika] +# Latest change: Sam Okt 06 13:23:59 CEST 2007 [mika] ################################################################################ if [ $UID != 0 ]; then @@ -23,12 +23,10 @@ if ! [ -n "$1" -a -n "$2" ] ; then exit 1 fi -[ -d /UNIONFS ] && UNIONFS="/UNIONFS" # running from live-CD? - DIRECTORY="$1" prepare_start () { - if ! mount | grep -q "tmpfs on ${UNIONFS}${DIRECTORY}" ; then + if ! mount | grep -q "tmpfs on ${DIRECTORY}" ; then if [ -d $DIRECTORY ] ; then if ! [ -d $DIRECTORY.tmpfile ] ; then echo -n "Setting up tmpfs ${DIRECTORY}: " @@ -58,7 +56,7 @@ prepare_start () { prepare_stop () { if mount | grep -q $DIRECTORY ; then echo -n "Unmounting tmpfs ${DIRECTORY}: " - umount ${UNIONFS}${DIRECTORY} && \ + umount ${DIRECTORY} && \ rmdir $DIRECTORY && \ mv $DIRECTORY.tmpfile $DIRECTORY && echo done || echo failed else