#!/bin/sh

REL=$1
if [ -z $REL ] ; then
    echo 'Usage: upload-release VERSION [DIR]'
    echo 'Must be called in directory with binaries or with path'
    exit 1
fi

if [ ! -z "$2" ] ; then
    cd "$2"
fi

sftp -b - nijel,gammu@frs.sourceforge.net <<EOT
cd /home/frs/project/g/ga/gammu/gammu
mkdir $REL
cd $REL
put gammu-$REL.tar.bz2
put gammu-$REL.tar.xz
put gammu-$REL.tar.gz
put gammu-$REL.zip
EOT

sftp -b - web <<EOT
cd /srv/http/dl.cihar.com/gammu/releases/
put gammu-$REL.tar.bz2
put gammu-$REL.tar.xz
put gammu-$REL.tar.gz
put gammu-$REL.zip
EOT
