summaryrefslogtreecommitdiff
path: root/ec2-init-appliance-ebs-volume-mount.sh
diff options
context:
space:
mode:
Diffstat (limited to 'ec2-init-appliance-ebs-volume-mount.sh')
-rwxr-xr-xec2-init-appliance-ebs-volume-mount.sh48
1 files changed, 0 insertions, 48 deletions
diff --git a/ec2-init-appliance-ebs-volume-mount.sh b/ec2-init-appliance-ebs-volume-mount.sh
deleted file mode 100755
index de3c63ca..00000000
--- a/ec2-init-appliance-ebs-volume-mount.sh
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-if [ -n "$EBSMOUNT_DEBUG" ]
-then
- do="echo"
- mktemp_args="-u"
-else
- do=""
- mktemp_args=""
-fi
-
-if [ "$#" -lt 2 ]
-then
- echo "Usage: $0 <EBS device> <path> [<path> [<path>...]]"
- exit 1
-fi
-
-ebs_volume_device="$1"
-shift
-
-canonicalise_dir() {
- dirname="$1"
- echo "${dirname}" | sed -e 's/[^a-zA-Z0-9]/_/g'
-}
-
-# The blkid call will detect whether there's already a filesystem on the EBS volume
-if [ -n "$(blkid -p -o udev "${ebs_volume_device}")" ]
-then
- $do mkfs.ext3 "${ebs_volume_device}"
-fi
-
-tmpdir="$(mktemp -d $mktemp_args --tmpdir=/var/run/ec2)"
-$do mount ${ebs_volume_device} ${tmpdir}
-
-for dir in "$@"
-do
- ebsdir="${tmpdir}/$(canonicalise_dir "${dir}")"
- if [ ! -d "${ebsdir}" ]
- then
- # We bootstrap the storage with the existing data
- $do mkdir "${ebsdir}"
- $do cp -a ${dir} "${ebsdir}"
- $do chown --reference "${dir}" "${ebsdir}"
- $do chmod --reference "${dir}" "${ebsdir}"
- fi
- # Finally, we mount it on top of the old directory.
- $do mount --bind "${ebsdir}" "${dir}"
-done