X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=functions.sh;h=5bb7ae6b1277107c9ceaa6d60eadd22a2dc3e4ce;hb=491a93c69b438d7fcbf3980185558dee614781ea;hp=e625d5181c4bfca5a073b322581f28bc44be7f52;hpb=8543c1ce1e1c728e89f4e1b4efd4a79f52d5ca2e;p=carnet-upgrade.git diff --git a/functions.sh b/functions.sh index e625d51..5bb7ae6 100644 --- a/functions.sh +++ b/functions.sh @@ -223,8 +223,12 @@ ${CP_NOTICE}----------" cp_safe_file_replace () { [ "$CP_SCRIPT_DEBUG" ] && set -vx local new old - new=$1 - old=$2 + if [ -z "$2" ]; then + echo "Usage: cp_safe_file_replace " 1>&2 + return 1 + fi + new="$1" + old="$2" if [ -e "$old" ]; then chown --reference "$old" "$new" chmod --reference "$old" "$new"