Skip to content

Instantly share code, notes, and snippets.

@saml
Created June 30, 2011 21:24
Show Gist options
  • Select an option

  • Save saml/1057278 to your computer and use it in GitHub Desktop.

Select an option

Save saml/1057278 to your computer and use it in GitHub Desktop.
#!/bin/bash
if (( $# < 3 ))
then
echo "usage: $0 src-host src-path dest-host [dest-path] [vlt rcp options]"
exit 1
fi
read -s -p "src-cred [default=admin:admin]: " cred1
if [[ -z "$cred1" ]]
then
cred1="admin:admin"
fi
echo ""
read -s -p "dest-cred [default=admin:admin]: " cred2
if [[ -z "$cred2" ]]
then
cred2="admin:admin"
fi
echo ""
host1="$1"
path1="$2"
host2="$3"
if (( $# >= 4 ))
then
path2="$4"
shift 4
else
path2="$path1"
shift 3
fi
vlt rcp $* "http://$cred1@$host1/crx/-/jcr:root$path1" "http://$cred2@$host2/crx/-/jcr:root$path2" | grep -v "http://"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment