#!/bin/bash
rm -rf tmp
ELEMENT_FILE_NAME=element.txt
TAR_FILE_NAME=aaa.tar.gz
arys=`cat $ELEMENT_FILE_NAME | grep ^u | cut -d ',' -f 2`
aryt=`cat $ELEMENT_FILE_NAME | grep ^u | cut -d ',' -f 3`
aryo=`cat $ELEMENT_FILE_NAME | grep ^u | cut -d ',' -f 4`
arym=`cat $ELEMENT_FILE_NAME | grep ^u | cut -d ',' -f 5`
i=0
for item in ${aryt[@]}; do
echo mkdir -p "tmp/${item%/*}"
echo svn export "${arys[$i]}" "tmp/${item%/*}"
let i++
done
chown -R 644 tmp
chmod -R root:root tmp
i=0
for item in ${arym[@]}; do
echo chmod "${item}" "${aryt[$i]}"
let i++
done
tar cvfp $TAR_FILE_NAME tmp
echo `md5sum $TAR_FILE_NAME`
sed -e "s/@@version@@/1.2.1/g" ./template.txt |\
sed -e "s/@@name@@/puroduct/g" > version.txt
テキストファイルを読み込んでsvn実行
svn,http://192.168.40.20/svn,,,,
server,/var/log/,,,,
target,svnpath,installpath,owner,gowner,mod
u,http://192.168.40.20/svn/module/aaa/ccc,/var/log/httpd/access_log,root,644
u,http://192.168.40.20/svn/module/aaa/ccc,/var/log/audit/audit.log,root,644
u,http://192.168.40.20/svn/module/aaa/bbb,/var/log/httpd/error_log,root,644