Scripts version 2090.1

This commit is contained in:
castro-fidel
2022-02-24 18:36:59 +03:00
parent 892de157cc
commit 1be7737322
4 changed files with 10 additions and 9 deletions

View File

@ -63,8 +63,8 @@ try_remove_dir () {
export -f try_remove_dir
try_force_link_file () {
if [ -z "$2" ] ; then
print_error "no way to link file $1"
if [ ! -f "$1" ] ; then print_info "file $1 not found for link"
elif [ -z "$2" ] ; then print_error "no way to link file $1"
else
ln -sf "$1" "$2"
[ "$?" != 0 ] && print_error "failed to link file $1 to $2" || return 0
@ -88,8 +88,8 @@ check_symlink () {
export -f check_symlink
try_force_link_dir () {
if [ -z "$2" ] ; then
print_error "no way to link directory $1"
if [ ! -d "$1" ] ; then print_info "directory $1 not found for link"
elif [ -z "$2" ] ; then print_error "no way to link directory $1"
else
ln -sf "$1" "$2"
[ "$?" != 0 ] && print_error "failed to link directory $1 to $2" || return 0