#!/bin/bash # Copyright GPL3 dat=$(date +"%Y-%m-%d") dat2=$(echo "$dat""T00:00:00") echo ".sbm archive creator 0.1" echo "" echo "" echo "Use this in the same directory as the voxforge achive is!" echo "" echo "Please specify the archive name:" echo "" ls echo "" echo "" read archname echo "" if [ -z "$archname" ]; then echo "" echo "You must specify a arcive name" echo "exiting" echo "" exit fi tar xzf $archname echo "" echo "tar ok" echo "" # remove endig .tgz .tar.bz2 or tar.gz brute force method cdname=$(echo $archname | sed s'/........$//') cdname2=$(echo "$cdname*") cd $cdname2 cd model_parameters/* #create metadata.xml awk_path="./metadata.xml" cat > "${awk_path}" < SED1 SED2 SPHINX EOT na=$cdname echo "" echo "" echo "Please specify the name of the language base modul:" echo "Enter to skip" echo "" read newNA if [ -z "$newNA" ]; then echo "" echo "using default name $cdname" echo "" else echo "" echo "Using enterned name: $newNA" echo "" na=$newNA fi # modify name of the sbm package sed -i "s/SED1/$na/g" metadata.xml sed -i "s/SED2/$dat2/g" metadata.xml tar -cvf tarballname.tar * gzip tarballname.tar mv tarballname.tar.gz $na.sbm cp $na.sbm ../../../ echo "" echo "" echo "Successfully created sbm archive for Simon" echo ""