Changeset 7298 in genesis


Ignore:
Timestamp:
Dec 2, 2009, 7:54:17 PM (15 years ago)
Author:
rick
Message:

Store tmp files in proper locations as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nodes/dubbelipcheck.sh

    r7297 r7298  
    88genesis_nodes_dir="`dirname $0`"
    99allowed_dubbel_ip="172.31.255.1 172.31.255.2"
    10 tmp_files="all_ips all_ips_no_double"
     10TMPDIR=`mktemp -d -t $(basename $0 .sh).XXXXX`
    1111
    1212ERRNO=0
     
    2121        link_ips=`cat $files | grep ^IP | grep -v '$master_ip' |\
    2222                                        sed -e 's/IP=//' -e 's/\/[0-9]*//'`
    23         echo "$master_ips $link_ips" | sort > all_ips
    24         echo "$master_ips $link_ips" | sort -u > all_ips_no_double
     23        echo "$master_ips $link_ips" | sort > $TMPDIR/all_ips
     24        echo "$master_ips $link_ips" | sort -u > $TMPDIR/all_ips_no_double
    2525}
    2626
     
    2828#check up dubbele ip addressen
    2929dubbelIpCheck() {
    30         dubbel_ips=`comm -23 all_ips all_ips_no_double | sort -u`
     30        dubbel_ips=`comm -23 $TMPDIR/all_ips $TMPDIR/all_ips_no_double | sort -u`
    3131}
    3232
     
    6565#verwijder tijdelijke files
    6666cleanup() {
    67         for file in $tmp_files ; do
    68                 rm $file
    69         done
     67    rm -R $TMPDIR
    7068}
    7169
Note: See TracChangeset for help on using the changeset viewer.