Created
January 12, 2014 14:33
-
-
Save sarim/8385289 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filename=$1 | |
| SOURCE1="../a" | |
| SOURCE2="../c" | |
| TARGET="deploy" | |
| PFILE="config.ini" | |
| ###################################### | |
| if [ -d $SOURCE1 ]; | |
| then | |
| SOURCE=$SOURCE1 | |
| else | |
| if [ -d $SOURCE2 ]; | |
| then | |
| SOURCE=$SOURCE2 | |
| else | |
| echo No Valid Source Directory found | |
| exit 1 | |
| fi | |
| fi | |
| ###################################### | |
| mv "$TARGET/$PFILE" $PFILE | |
| rm -rf $TARGET | |
| mkdir $TARGET | |
| mv $PFILE "$TARGET/$PFILE" | |
| ###################################### | |
| while read line | |
| do | |
| cp -R "$SOURCE/$line" "$TARGET/$line" | |
| RETVAL=$? | |
| if [ $RETVAL -ne 0 ]; | |
| then | |
| exit 2 | |
| fi | |
| done < $filename | |
| echo All Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment