Skip to content

Instantly share code, notes, and snippets.

@debajyoti-thetaonelab
Created March 19, 2019 08:34
Show Gist options
  • Select an option

  • Save debajyoti-thetaonelab/e6f4eb08974a7feec530c8511a81d595 to your computer and use it in GitHub Desktop.

Select an option

Save debajyoti-thetaonelab/e6f4eb08974a7feec530c8511a81d595 to your computer and use it in GitHub Desktop.
some description
#!/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