🗃️ Committing everything that changed 🗃️

rootfs/usr/local/bin/copy
rootfs/usr/local/bin/symlink
This commit is contained in:
casjay
2024-09-04 08:53:20 -04:00
parent 9ff4bd6af5
commit 392d3c59ce
2 changed files with 4 additions and 2 deletions

View File

@@ -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