l3.cas-d-astre/tools/cda-update

25 lines
680 B
Text
Raw Normal View History

2009-05-01 08:39:36 +00:00
#!/bin/bash
SSH_USER=$1
if [ $SSH_USER="" ]; then
SSH_USER=$USER
fi
LOCAL_CDA_DIR=$(pwd)
DIST_CDA_DIR=/home/$SSH_USER/public_html/CDA/
DIST_CDA_SERV=ssh.shamox.ath.cx
echo -e "User : \t$SSH_USER"
echo -e "Local Dir : \t$LOCAL_CDA_DIR"
echo -e "Remote Dir : \t$DIST_CDA_DIR"
echo -e "Server : \t$DIST_CDA_SERV"
echo -e -n "Erasing previous version... "
ssh -C $DIST_CDA_SERV -- mkdir -p $DIST_CDA_DIR
ssh -C $DIST_CDA_SERV -- rm -r $DIST_CDA_DIR
echo -e "done"
echo -e "Updating current version... "
ssh -C $DIST_CDA_SERV -- mkdir -p $DIST_CDA_DIR
( cd $LOCAL_CDA_DIR; \
scp -C -r $LOCAL_CDA_DIR/* $SSH_USER@$DIST_CDA_SERV:$DIST_CDA_DIR )
echo -e "Update done"