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/sh # # send -- send files or the current directory, to FARMACHINE by ssh # [ -n "$echo" ] && set -x USAGE='send [file2] ...' # no options allowed case "$1" in -*) echo "$USAGE" >&2 exit 2 ;; esac ME='leavens' FARMACHINE='larch.cs.iastate.edu' AWAY="$FARMACHINE:/home/bambam/$ME" STATUS=0 # get part of directory name below $HOME or $ALTHOME fulldir=`pwd` case "$fulldir" in $HOME) below=. if test "$#" -eq 0 then echo "ERROR: can't send everything in $HOME" >&2 exit 1 fi ;; *) below=`expr $fulldir : $HOME/'\(.*\)'` ;; esac awaybelow="$below" case "$below" in 0|'') echo "can't send from $fulldir, not under $HOME" >&2 exit 1 ;; bin|bin/Obsolete|bat) awaybelow="WWW/Windows/$below" if test $# -le 0 then echo "can't update all of $below" >&2 exit 2 fi ;; *) ;; esac echo "sending to ~/${awaybelow} on $FARMACHINE" if test $# -gt 0 then for f do scp -p "$f" "$AWAY/${awaybelow}/" || STATUS=1 ssh "$FARMACHINE" chmod go-w "~/'${awaybelow}/$f'" done else rsync --rsync-path=/usr/bin/rsync -aup --exclude='*~' . "${AWAY}/${awaybelow}" || STATUS=1 ssh "$FARMACHINE" chmod -R go-w "~/'${awaybelow}/'" fi exit $STATUS