[sheepdog] [PATCH v3 03/12] script: remove script/simple2farm
Kai Zhang
kyle at zelin.io
Tue May 14 09:51:48 CEST 2013
Signed-off-by: Kai Zhang <kyle at zelin.io>
---
script/simple2farm | 51 ---------------------------------------------------
1 files changed, 0 insertions(+), 51 deletions(-)
delete mode 100755 script/simple2farm
diff --git a/script/simple2farm b/script/simple2farm
deleted file mode 100755
index 0743f20..0000000
--- a/script/simple2farm
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/bash
-
-# This script is used to translate simple store backend into Farm.
-# Usage: simple2farm /path/to/store/obj
-
-set -e
-
-E_BADARGS=65
-
-if [ $# -ne 1 ]; then
- echo "Usage: `basename $0` /path/to/store/obj"
- exit $E_BADARGS
-fi
-
-if [ `basename $1` != "obj" ]; then
- echo "You should specify path to store/obj"
- exit $E_BADARGS
-fi
-
-if [ "$(pgrep sheep)" ]; then
- echo "You need to shutdown cluster first"
- exit 1
-fi
-
-cd $1
-
-config_offset=11
-# Get the backend store from config file
-echo "Read config file"
-store=$(od --skip-bytes=$config_offset -An -c ../config | sed 's/ //g' | sed 's/\\0//g')
-if [ "x$store" == "xfarm" ]; then
- echo "It's already the farm store, we'er done"
- exit 0
-fi
-
-# find the highest numbered directory, remove older ones
-max=00000001
-for i in *; do
- if [ $i -gt $max ]; then
- rm -rf $max
- max=$i
- fi
-done
-
-echo "Find the highest numbered directory $max"
-echo "Try to move the objects..."
-mv $max/* .
-rmdir $max
-echo "Update config file"
-echo -en 'farm\0' | dd of=../config seek=$config_offset bs=1 2> /dev/null
-echo "Now simple store has been tranformed into Farm"
--
1.7.1
More information about the sheepdog
mailing list