aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-04-15 12:47:42 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2014-04-15 12:47:42 +0300
commit8d93a2e18b48ef6c94f25af7cb621747ba709cbe (patch)
tree7dc0a99c8f180739cf7621dc357a1f5a61b191a4
parentc07d4063d83acb57eab60d3045b078d4a8fbc86a (diff)
downloadscripts-8d93a2e18b48ef6c94f25af7cb621747ba709cbe.tar.gz
scripts-8d93a2e18b48ef6c94f25af7cb621747ba709cbe.tar.bz2
ec2snapshot: handle both sd* and xvd* devices.
-rwxr-xr-xec2snapshot16
1 files changed, 11 insertions, 5 deletions
diff --git a/ec2snapshot b/ec2snapshot
index ea56258..ec27256 100755
--- a/ec2snapshot
+++ b/ec2snapshot
@@ -80,11 +80,7 @@ getinstid() {
fi
}
-dev2volume() {
- getinstid
- case $1 in
- /dev/xv*) set -- /dev/s${1##/dev/xv}
- esac
+dev2volume0() {
unset volume
runeclat "getting volume ID for $1" "volume" \
'if (.DescribeInstancesResponse.reservationSet) {
@@ -99,6 +95,16 @@ dev2volume() {
}' describe-instances $instid
}
+dev2volume() {
+ getinstid
+ dev2volume0 $1
+ if [ -z "$volume" ]; then
+ case $1 in
+ /dev/xv*) dev2volume /dev/s${1##/dev/xv}
+ esac
+ fi
+}
+
fs2volume() {
local dev
dev=$(awk '$2=="'$1'" { print $1; exit }' /etc/mtab)

Return to:

Send suggestions and report system problems to the System administrator.