#!/usr/bin/env mksh # $Id: UP,v 1.6 2008/08/30 11:58:03 tg Exp $ # sync MirOS Website from primary anoncvs mirror if wd=$(readlink -nf .); then vd=$(readlink -nf $(dirname $0)) else wd=$(pwd) cd $(dirname $0) vd=$(pwd) fi cd $vd p= a=0 sshx="--rsh=ssh -T" what=/www # WARNING: --delete is omitted here while :; do if [[ $1 = -H ]]; then shift elif [[ $1 = -4 ]]; then sshx="$sshx -4" shift else break fi done case $1 { (q) p= ;; (c) p=-cPv ;; (C) p=-c ;; (v) p=-v ;; (*) p=-Pv ;; } [[ -n $1 || -n $2 ]] && shift [[ -e $HOME/.etc/anonkey.mirbsd ]] && sshx="$sshx -i $HOME/.etc/anonkey.mirbsd" set -x nice rsync -rxlztpgaHK --stats --exclude=/ign/ "$sshx" $p "$@" \ ${CVSROOT:-anoncvs@anoncvs.mirbsd.org:$what}/ $vd cd $wd [[ $a = 1 ]] && exec /bin/mksh -c "umount $vd; mount $vd" exit 0