sfupload 612 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # SYNTAX:
  3. # sfupload {version} [username]
  4. # Quick script to upload new nagiosplug tarball to SF
  5. # Expects $1 = version number of tarball
  6. # $2 to be username on SF, defaults to $USER
  7. # Expects to be run from top level dir
  8. function die { echo $1; exit 1; }
  9. tarball="nagios-plugins-$1.tar.gz"
  10. if [[ ! -e $tarball ]]; then
  11. die "No tarball found: $tarball";
  12. fi
  13. md5sum $tarball > $tarball.md5sum
  14. user=${2:-$USER}
  15. echo "Logging in as $user"
  16. cat <<EOF | sftp $user@frs.sourceforge.net || die "Cannot upload to SF"
  17. cd uploads
  18. put $tarball
  19. put $tarball.md5sum
  20. EOF
  21. echo "Finished uploading files to SF"