diff --git a/rootfs/usr/local/bin/copy b/rootfs/usr/local/bin/copy index 537a2ff..8227966 100755 --- a/rootfs/usr/local/bin/copy +++ b/rootfs/usr/local/bin/copy @@ -55,7 +55,8 @@ COPY_EXIT_STATUS=0 # Main application { [ $# -eq 2 ] || [ "$1" = "--help" ]; } || { __printf_color "Usage: $APPNAME fromFile toFile" && exit 1; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if [ "$1" != "$2" ]; then +is_link="$(ls -la "$2" 2>/dev/null | awk '{print $NF}')" +if [ "$1" != "$is_link" ]; then if [ -d "$1" ]; then mkdir -p "$2" cp -Rf "$1/." "$2/" diff --git a/rootfs/usr/local/bin/symlink b/rootfs/usr/local/bin/symlink index cc304c0..8bfb03e 100755 --- a/rootfs/usr/local/bin/symlink +++ b/rootfs/usr/local/bin/symlink @@ -55,7 +55,8 @@ SYMLINK_EXIT_STATUS=0 # Main application { [ $# -eq 2 ] || [ "$1" = "--help" ]; } || { __printf_color "Usage: $APPNAME fromFile toFile" && exit 1; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -if [ "$1" != "$2" ]; then +is_link="$(ls -la "$2" 2>/dev/null | awk '{print $NF}')" +if [ "$1" != "$is_link" ]; then if [ -L "$2" ]; then unlink "$2" elif [ -e "$2" ]; then