Ignore:
Timestamp:
Oct 9, 2007, 2:27:21 AM (17 years ago)
Author:
tabbott
Message:

1) reworking of lvm stuff into a single python script rather than a pile of shell scripts

2) changing naming for database VMs to always start with d_

File:
1 edited

Legend:

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

    r132 r146  
    4747}
    4848
     49check_machine_name()
     50{
     51    machine="$1"
     52    if ! perl -0e 'exit($ARGV[0] !~ /^[A-Za-z0-9][A-Za-z0-9._-]*$/)' -- "$machinename"; then
     53        echo "Bad machine name"
     54        exit 1
     55    fi
     56}
     57
    4958case "$1" in
    5059    moiragroup)
     
    7786    unregister)
    7887        machine="$2"
     88        check_machine_name "$machine"
    7989        rm -f "$ACLDIR"/"$machine"
    8090        rm -f "$MACHINEDIR"/"$machine"
     
    8494        oldmachine="$2"
    8595        newmachine="$3"
     96        check_machine_name "$oldmachine"
     97        check_machine_name "$newmachine"
    8698        mv "$ACLDIR"/"$oldmachine" "$ACLDIR"/"$newmachine"
    8799        rm -f "$MACHINEDIR"/"$oldmachine"
     
    90102    register)
    91103        machine="$2"
    92         if [ "$machine" == "Domain-0" ]; then
    93             echo "No, you can't control Domain 0"
    94             exit 1
    95         fi
    96         if [ -e /etc/xen/"$machine" ]; then
    97             echo "Machine already exists outside database"
    98             exit 1
    99         fi
     104        check_machine_name "$machine"
    100105        if [ -e "$ACLDIR"/"$machine" ]; then
    101106            echo "Machine already registered"
Note: See TracChangeset for help on using the changeset viewer.