summaryrefslogtreecommitdiff
path: root/ec2-init-appliance-ebs-volume-mount.sh
diff options
context:
space:
mode:
authorScott Moser <smoser@nelson>2010-01-07 21:40:44 -0500
committerScott Moser <smoser@nelson>2010-01-07 21:40:44 -0500
commit41268c94d0f832d6a6dade0fffb7ddc0cd7a1a6c (patch)
treec578859cbdf70d38af582b00d1f81229fbee62c4 /ec2-init-appliance-ebs-volume-mount.sh
parent938ba376f2c7551a471991b4046e11a4f92f30d5 (diff)
downloadvyos-cloud-init-41268c94d0f832d6a6dade0fffb7ddc0cd7a1a6c.tar.gz
vyos-cloud-init-41268c94d0f832d6a6dade0fffb7ddc0cd7a1a6c.zip
remove dead/unused code, call this 0.5.0
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