Created
October 25, 2019 10:57
-
-
Save wsgzao/0ef320a331a2eca8da8f745d116592ef to your computer and use it in GitHub Desktop.
Get symlink real path and copy nginx site-enabled files to new place
This file contains 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 | |
dir_new="/tmp/wangao/*/sites-enabled/" | |
for link in $(find ./ -type l) | |
do | |
echo | |
echo "Link is:" | |
echo $link | |
realpath=$(readlink -f $link) | |
echo $dir | |
# rm $link | |
# cp $realpath $link -rf | |
cp --remove-destination $realpath $dir_new | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment