mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
add script to sync; rename to put all in directory
This commit is contained in:
parent
1e5757dc45
commit
d66208a1f2
2 changed files with 73 additions and 0 deletions
73
xwords4/android/website/sync_site.sh
Executable file
73
xwords4/android/website/sync_site.sh
Executable file
|
@ -0,0 +1,73 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -u -e
|
||||
|
||||
HOST=eehouse.org
|
||||
USER=eehouse
|
||||
WEBROOT=/var/www/xw4sms
|
||||
ACTION=""
|
||||
|
||||
usage() {
|
||||
[ $# -ge 1 ] && echo "ERROR: $1" 1>&2
|
||||
echo "usage: $0 --push|--pull \\"
|
||||
echo " [--host <host>] # default: $HOST \\"
|
||||
echo " [--root <root>] # default: $WEBROOT \\"
|
||||
echo " [--user <user>] # default: $USER \\"
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
while [ $# -ge 1 ]; do
|
||||
echo $1
|
||||
case $1 in
|
||||
--push)
|
||||
ACTION=push
|
||||
;;
|
||||
--pull)
|
||||
ACTION=pull
|
||||
;;
|
||||
--host)
|
||||
shift
|
||||
HOST=$1
|
||||
;;
|
||||
--root)
|
||||
shift
|
||||
WEBROOT=$1
|
||||
;;
|
||||
--user)
|
||||
shift
|
||||
USER=$1
|
||||
;;
|
||||
*)
|
||||
usage "Unexpected param $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
cd $(dirname $0)
|
||||
FILES=""
|
||||
for FILE in $(find . -type f); do
|
||||
# echo "file: $FILE"
|
||||
case $FILE in
|
||||
*/$(basename ${0}))
|
||||
;;
|
||||
*~)
|
||||
;;
|
||||
*)
|
||||
FILES="$FILES $FILE"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
echo $FILES
|
||||
#exit 0
|
||||
|
||||
if [ "$ACTION" = push ]; then
|
||||
rsync -avz --exclude=*~ --exclude=$(basename $0) . ${USER}@${HOST}:${WEBROOT}/
|
||||
elif [ "$ACTION" = pull ]; then
|
||||
rsync ${USER}@${HOST}: .
|
||||
else
|
||||
usage "--push or --pull required"
|
||||
fi
|
||||
|
Loading…
Reference in a new issue