diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2008-11-14 20:38:26 (GMT) |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2008-11-14 20:38:26 (GMT) |
commit | e77ddaf6db1621001634fb5602ea42a59cf0660c (patch) | |
tree | 8dee183745e0873ac328be1f40051cade5202e63 /tools | |
parent | 9fbc0c14005e2a70996a539dbad5f1ebd9f2fcd6 (diff) | |
download | monitoring-plugins-e77ddaf6db1621001634fb5602ea42a59cf0660c.tar.gz |
Helper script to upload tarballs to SF and create md5sum
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2081 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/sfupload | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/sfupload b/tools/sfupload new file mode 100755 index 0000000..8925fcb --- /dev/null +++ b/tools/sfupload | |||
@@ -0,0 +1,27 @@ | |||
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 | |||
9 | function die { echo $1; exit 1; } | ||
10 | |||
11 | tarball="nagios-plugins-$1.tar.gz" | ||
12 | |||
13 | if [[ ! -e $tarball ]]; then | ||
14 | die "No tarball found: $tarball"; | ||
15 | fi | ||
16 | md5sum $tarball > $tarball.md5sum | ||
17 | |||
18 | user=${2:-$USER} | ||
19 | echo "Logging in as $user" | ||
20 | cat <<EOF | sftp $user@frs.sourceforge.net || die "Cannot upload to SF" | ||
21 | cd uploads | ||
22 | put $tarball | ||
23 | put $tarball.md5sum | ||
24 | EOF | ||
25 | |||
26 | echo "Finished uploading files to SF" | ||
27 | |||