-
-
Save debajyoti-thetaonelab/e6f4eb08974a7feec530c8511a81d595 to your computer and use it in GitHub Desktop.
some description
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
| #!/bin/bash | |
| COPY_OR_RESTORE=$1 | |
| TARGET=$HOME/.local | |
| src="egov-collection/src/main/resources/config/payment-gateway.properties egov-egi/src/main/resources/config/application-config.properties" | |
| function file_exists() { | |
| s=$1 | |
| if [[ ! -e $s ]];then | |
| echo "$s doesn't exists, error" | |
| exit 4 | |
| fi | |
| } | |
| if [[ $COPY_OR_RESTORE = "c" ]]; then | |
| # cd egov | |
| for s in $src; do | |
| file_exists $s | |
| cp $s $TARGET | |
| done | |
| elif [[ $COPY_OR_RESTORE = "r" ]]; then | |
| # cd egov | |
| for s in $src; do | |
| y=$s | |
| file_exists $s | |
| filename_=$(basename $s) | |
| src_path=$TARGET/$filename_ | |
| file_exists $src_path | |
| cp $src_path $y | |
| done | |
| else | |
| echo "USAGE $(basename $0) c|r" | |
| exit 100 | |
| fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment