#!/bin/sh
export TZ=Australia/Melbourne
cd ~/cron_scripts/currconv/public
today=`date +\%Y-\%m-\%d`
[ -e ratehistory/$today,1.txt ] && run=2 || run=1
cp currencyrates.txt ratehistory/$today,$run.txt
~/bin/units_cur currency.units && ~/bin/currencyconv.sh

# SFTP upload to Tilde.club Gopher server
#echo "cd public_gopher/currconv
#put currency.units
#put gophermap" | sftp -q -C -b - tclub 2>&1

# SFTP upload to Aussies.space Gopher server
echo "cd gopher/currconv
put gophermap" | sftp -F /home/freet/.ssh/config -q -C -b - aussies 2>&1
