tm_mkextend.sh
| 1 | #!/bin/bash |
|---|---|
| 2 | |
| 3 | # -------------------------------------------------------------------------- # |
| 4 | # Copyright 2002-2009, Distributed Systems Architecture Group, Universidad # |
| 5 | # Complutense de Madrid (dsa-research.org) # |
| 6 | # # |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # |
| 8 | # not use this file except in compliance with the License. You may obtain # |
| 9 | # a copy of the License at # |
| 10 | # # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 # |
| 12 | # # |
| 13 | # Unless required by applicable law or agreed to in writing, software # |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, # |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # |
| 16 | # See the License for the specific language governing permissions and # |
| 17 | # limitations under the License. # |
| 18 | #--------------------------------------------------------------------------- # |
| 19 | |
| 20 | if [ -z "${ONE_LOCATION}" ]; then
|
| 21 | TMCOMMON=/usr/lib/one/mads/tm_common.sh |
| 22 | else |
| 23 | TMCOMMON=$ONE_LOCATION/lib/mads/tm_common.sh |
| 24 | fi |
| 25 | |
| 26 | . $TMCOMMON |
| 27 | |
| 28 | SIZE=$1 |
| 29 | DST=$2 |
| 30 | |
| 31 | DST_PATH=`arg_path $DST` |
| 32 | DST_HOST=`arg_host $DST` |
| 33 | DST_DIR=`dirname $DST_PATH` |
| 34 | |
| 35 | exec_and_log "ssh $DST_HOST mkdir -p $DST_DIR" |
| 36 | exec_and_log "ssh $DST_HOST sudo ${ONE_LOCATION}/bin/fit $DST_PATH ${SIZE}"
|
| 37 | exec_and_log "ssh $DST_HOST chmod a+rw $DST_PATH" |