source: trunk/tools/file2ftp @ 592

Last change on this file since 592 was 592, checked in by bcornec, 13 years ago

merge -r 587:591 $SVN_M/branches/stable

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.0 KB
Line 
1#!/bin/bash
2#
3# Deliver tgz files to ftp.mondorescue.org
4#
5# $Id: file2ftp 592 2006-05-29 11:16:33Z bcornec $
6#
7
8dname=`dirname $0`
9prem=`echo $dname |cut -c1`
10if [ ${prem} == "/" ]; then
11        export TOOLHOME=$dname
12else
13    export TOOLHOME=${PWD}/$dname
14fi
15
16. $TOOLHOME/common-env
17. $TOOLHOME/distro-env
18. $TOOLHOME/ftp-env
19
20# We need to get $VER and $TAG
21if [ "$1" = "" ]; then
22    LAST=`cat ${TOPDIR}/LAST`
23else
24    LAST=$1
25    shift
26fi
27VER=`echo $LAST | cut -d- -f1`
28TAG=`echo $LAST | cut -d- -f2`
29echo "Working on ${VER}-$TAG"
30   
31if [ "$1" = "" ]; then
32    c="mondo-doc mindi mondo"
33else
34    if [ "$1" = "all" ]; then
35        c="mindi-kernel mondo-doc mindi mondo"
36    else
37        c=$1
38    fi
39fi
40
41export src=""
42echo "Working under $TOPBUILDDIR"
43cd $TOPBUILDDIR
44
45for p in $c; do
46    src="$src ${TOPDIR}/${VER}-$TAG/$p-[1-9st]*.tar.gz"
47done
48
49echo "Sources delivery to ${ACCOUNT}:${DSTDIR}/src"
50scp -p ${src} ${ACCOUNT}:${DSTDIR}/src
51
52echo "Sources delivery to ${FTPSERV} ${FTPDIR}"
53if [ "`which ncftpput`" != "" ]; then
54    ncftpput ${FTPSERV} ${FTPDIR} ${src}
55elif [ "`which lftp`" != "" ]; then
56    lftp -e "cd ${FTPDIR} ; put ${src} ; quit" ${FTPSERV}
57fi
Note: See TracBrowser for help on using the repository browser.