#!/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 nijel,gammu@frs.sourceforge.net <<EOT
cd /home/frs/project/g/ga/gammu/gammu
mkdir $REL
cd $REL
put Gammu-$REL-Windows-Minimal.exe
put Gammu-$REL-Windows-Minimal.zip
put Gammu-$REL-Windows.exe
put Gammu-$REL-Windows.zip
put gammu-$REL.tar.bz2
put gammu-$REL.tar.gz
EOT

sftp mort <<EOT
cd /srv/http/dl.cihar.com/gammu/releases/windows/
put Gammu-$REL-Windows-Minimal.exe
put Gammu-$REL-Windows-Minimal.zip
put Gammu-$REL-Windows.exe
put Gammu-$REL-Windows.zip
cd /srv/http/dl.cihar.com/gammu/releases/
put gammu-$REL.tar.bz2
put gammu-$REL.tar.gz
EOT
