2013-10-16 17:32:43 +02:00
#!/bin/sh
# This script copies the packages feed & images directory to ~/Sites (e.g. for use with XAMPP or the like).
# Using the -u option, it can also upload to doodle3d.com/updates (make sure ssh automatically uses the correct username, or change the rsync command below).
# Modify WIFIBOX_BASE_DIR to point to your wifibox directory tree.
WIFIBOX_BASE_DIR = ~/Files/_devel/eclipse-workspace/wifibox
DEST_DIR = ~/Sites/wifibox
UPDATES_DIR = updates
BASE_URL = doodle3d.com
OPTIONS = $DEST_DIR
UPLOAD_FILES = 0
for arg in " $@ " ; do
case $arg in
-h)
echo " This script calls 'create-wifibox-updates-dir.sh' to generate feed/image directories in $DEST_DIR "
echo "Use '-z' to also create a compressed file containing the 'updates' directory."
echo "Used '-u' to also upload the directory to doodle3d.com/updates"
exit
; ;
-z)
OPTIONS = " $OPTIONS -z "
; ;
-u)
UPLOAD_FILES = 1
; ;
*)
echo " Unrecognized option ' $arg ' "
exit 1
; ;
esac
done
$WIFIBOX_BASE_DIR /extra/scripts/create-wifibox-updates-dir.sh $OPTIONS
2013-10-16 19:04:33 +02:00
RETURN_VALUE = $?
if [ $RETURN_VALUE -ne 0 ] ; then
echo " create-wifibox-updates-dir.sh returned an error ( ${ RETURN_VALUE } ), exiting "
exit $RETURN_VALUE
fi
2013-10-16 17:32:43 +02:00
if [ $UPLOAD_FILES -eq 1 ] ; then
2013-12-18 13:29:53 +01:00
#UPLOAD_PATH=$BASE_URL:public_html/updates
UPLOAD_PATH = $BASE_URL :doodle3d.com/DEFAULT/updates
2013-10-16 17:32:43 +02:00
cat <<-'EOM' > $DE ST_DIR/$UPDATES_DIR /.htaccess
Options +Indexes
EOM
echo " Uploading files to $UPLOAD_PATH (if you are asked for your password, please add an entry to your ~/.ssh/config and upload your public ssh key) "
#options are: recursive, preserve perms, symlinks and timestamps, be verbose and use compression
rsync -rpltvz -e ssh --progress $DEST_DIR /$UPDATES_DIR /.htaccess $DEST_DIR /$UPDATES_DIR /* $UPLOAD_PATH
fi