Ignore:
Timestamp:
Aug 5, 2007, 10:11:50 PM (17 years ago)
Author:
andersk
svk:copy_cache_prev:
62
Message:

Stop scaring me with unquoted variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/remctl-update.sh

    r32 r63  
    1414{
    1515    machine=$1
    16     sed "s/#MACHINENAME#/$machine/g" $TEMPLATE | \
    17         sed "s,#BINDIR#,$BINDIR,g" >| $MACHINETMP
    18     if ! cmp -s $MACHINEDIR/$machine $MACHINETMP; then
    19         mv $MACHINETMP $MACHINEDIR/$machine
     16    sed "s/#MACHINENAME#/$machine/g" "$TEMPLATE" | \
     17        sed "s,#BINDIR#,$BINDIR,g" >| "$MACHINETMP"
     18    if ! cmp -s "$MACHINEDIR/$machine" "$MACHINETMP"; then
     19        mv "$MACHINETMP" "$MACHINEDIR/$machine"
    2020    else
    21         rm -f $MACHINETMP
     21        rm -f "$MACHINETMP"
    2222    fi
    2323}
     
    3131    # all bits and delete the moira-acl files whenever there's an AFS
    3232    # outage.
    33     pts membership system:$group -noauth | tail -n+2 | \
    34         sed 's/\./\//' | \
    35         sed 's/^  //' | \
    36         sed 's/$/@ATHENA.MIT.EDU/g' >| $MOIRATMP
    37     if test -s $MOIRATMP; then
    38         if ! cmp -s $MOIRADIR/$group $MOIRATMP; then
    39             mv $MOIRATMP $MOIRADIR/$group
     33    pts membership -nameorid "system:$group" -noauth | tail -n+2 | \
     34        sed 's/\./\//; s/^  //; s/$/@ATHENA.MIT.EDU/g' >| "$MOIRATMP"
     35    if test -s "$MOIRATMP"; then
     36        if ! cmp -s "$MOIRADIR/$group" "$MOIRATMP"; then
     37            mv "$MOIRATMP" "$MOIRADIR/$group"
    4038        fi
    4139    else
    42         if test -e $MOIRADIR/$group; then
    43             rm $MOIRADIR/$group
     40        if test -e "$MOIRADIR/$group"; then
     41            rm "$MOIRADIR/$group"
    4442        fi
    4543    fi
    46     rm -f $MOIRATMP
     44    rm -f "$MOIRATMP"
    4745}
    4846
     
    5452    all_machines)
    5553        # update the remctl.conf definitions
    56         for machine in `cat $AUTOMACHINELIST`; do
    57             update_machine $machine
     54        for machine in `cat "$AUTOMACHINELIST"`; do
     55            update_machine "$machine"
    5856        done
    5957        ;;
    6058    all_moira)
    6159        # update our moira ACL lists
    62         for group in `cat $AUTOMOIRALIST`; do
    63             update_moiragroup $group
     60        for group in `cat "$AUTOMOIRALIST"`; do
     61            update_moiragroup "$group"
    6462        done
    6563        ;;
    6664    auto_machine_list)
    6765        # update the list of maintained machines
    68         /bin/ls $ACLDIR >| $AUTOMACHINELIST
     66        /bin/ls "$ACLDIR" >| "$AUTOMACHINELIST"
    6967        ;;
    7068    auto_moira_list)
    7169        # update the moira list-of-lists
    72         # /bin/ls $MOIRADIR >| $AUTOMOIRALIST # BAD IDEA in case of outage
     70        # /bin/ls "$MOIRADIR" >| "$AUTOMOIRALIST" # BAD IDEA in case of outage
    7371
    7472        # This extracts the list of all moira lists we care about, and updates those.
    75         grep -R moira $ACLDIR/ /etc/remctl/acl/ | perl -pe 's/.*moira-acl\/(.*)/$1/g' >| $AUTOMOIRALIST
     73        grep -R moira "$ACLDIR/" /etc/remctl/acl/ | perl -pe 's/.*moira-acl\/(.*)/$1/g' >| "$AUTOMOIRALIST"
    7674        ;;
    7775    all)
Note: See TracChangeset for help on using the changeset viewer.