#!/bin/sh
#
# Copyright (C) 2000-2017 Kern Sibbald
# License: BSD 2-Clause; see file LICENSE-FOSS
#
# Upload to File Release System on serfullver
#
. ./config

ver="7.9.0"
RSYNC="rsync -av --no-g --progress $upload_opt"

do_upload()
{
where=$1
echo "Creating ${where}:/home/src/$fullver"
ssh ${where} <<EOF
cd /home/src/
mkdir -p $ver
EOF

echo "Uploading source"
for i in bacula-$ver* bacula-*-$ver*; do \
   echo "Uplod $i to ${where}:/home/src/$ver"
   $RSYNC $i ${where}:/home/src/$ver/; \
done

# Upload release notes
echo "Uplod ReleaseNotes to ${where}:/home/src/$ver"
$RSYNC ReleaseNotes ${where}:/home/src/$ver/
echo "Uplod ChangeLog to ${where}:/home/src/$ver"
$RSYNC ChangeLog ${where}:/home/src/$ver/
$RSYNC LICENSE* ${where}:/home/src/$ver/


}

do_upload bacula
