Changeset 63


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.

Location:
trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/debian/changelog

    r32 r63  
     1sipb-xen-remctl-auto (1.0.1) unstable; urgency=low
     2
     3  * Stop scaring me with unquoted variables.
     4
     5 -- Anders Kaseorg <andersk@mit.edu>  Sun, 05 Aug 2007 22:11:02 -0400
     6
    17sipb-xen-remctl-auto (1.0) unstable; urgency=low
    28
  • trunk/packages/sipb-xen-remctl-auto/sipb-xen-remctl-auto/files/etc/remctl/sipb-xen-auto/bin/dispatch.sh

    r32 r63  
    1010# need them for this script.
    1111
    12 ACTION=$(echo $0 | awk -F'.' '{print $2}')
     12ACTION=$(echo "$0" | awk -F'.' '{print $2}')
    1313MACHINE=$1
    14 echo $ACTION
     14echo "$ACTION"
    1515
    1616case "$ACTION" in
    1717    reboot|list|vcpu-list|destroy|create|uptime)
    18         xm $ACTION $MACHINE
     18        xm "$ACTION" "$MACHINE"
    1919        exit 0
    2020        ;;
  • 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.