Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
#!/bin/bash
VER=1.0.2
LDCOPYTMP=/tmp/ldcopy.tmp
function help () {
cat < [--follow] [--test] /path/to/program
Note:
By default, ldcopy tries to preserve symbolic links (ie: copies a
symbolic link as symbolic link) and then if broken links were found
in destination directories, copies only the broken ones as realities.
\`--follow' option forces ldcopy to \`cp' files as realities right
from the start. With \`--test' option, script will do nothing but
printing what to be done and check of broken links.
EOF
exit 0
}
function err () {
case $1 in
nodir)
echo ERROR: target directory $CHROOTDIR does not exist, exitting..;;
noexe)
echo ERROR: no such executable \`$PROG\';;
nodyna)
echo ERROR: \`$PROG\' is not a dynamic executable;;
esac
exit 1
}
function uniqdirs () {
awk -v d=$CHROOTDIR 'BEGIN{
for (i=1; i") print $(i-1)
break
}
}
}')
[ -z "${LIBS[*]}" ] && err nodyna
if [ "$TEST" = "1" ]; then
PRE=echo
else
touch $LDCOPYTMP || echo ERROR: can not make temp file, exitting..
fi
N=0
for i in ${LIBS[@]} ; do
DIR=$(dirname $i)
if [ ! -d ${CHROOTDIR}$DIR ]; then
$PRE mkdir -vp ${CHROOTDIR}$DIR
NEWDIRS[$N]=$DIR
: $((N+=1))
fi
$PRE cp $CPOPT $i ${CHROOTDIR}$DIR
done
[ "$TEST" != "1" -a $N -gt 0 ] && fixperm
[ "$TEST" != "1" -a "$FOLLOW" != "1" ] && checklink -q
checklink
rm -f $LDCOPYTMP
exit 0