#!/bin/sh if [ $# -lt 7 ]; then cat < $tmpfile cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT -U$USERNAME%$PASSWORD //$SERVER/recycle -I$SERVER_IP $ADDARGS < $tmpfile 2>&1' eval echo "$cmd" out=$(eval "$cmd") ret=$? rm -f "$tmpfile" if [ $ret != 0 ]; then printf "%s\n" "$out" printf "failed recycle smbclient run with error %s\n" "$ret" return 1 fi test -e "$share_test_dir/.trash/testfile1" || { printf ".trash/testfile1 expected to exist but does NOT exist\n" return 1 } test -e "$share_test_dir/.trash/testfile2.tmp" && { printf ".trash/testfile2.tmp not expected to exist but DOES exist\n" return 1 } perm_want=755 perm_is=`stat -c '%a' "$share_test_dir/.trash/"` test "$perm_is" = "$perm_want" || { printf ".trash/ permission should be $perm_want but is $perm_is\n" return 1 } return 0 } testit "recycle" \ test_recycle || failed=$((failed + 1)) # # Cleanup. do_cleanup testok "$0" "$failed"