Revision 314b080b rename

b/rename
72 72
        ;;
73 73
esac
74 74

  
75
if [ "$OLD_HNAME" = "$old_name" ]; then
75
if [ "$OLD_HNAME" = "$old_name" \
76
        -o "${OLD_HNAME}.$(echo $old_name | cut -d . -f 2,3)" \
77
        = "$old_name"] ; then
76 78
    case "${OS_TYPE}" in
77 79
        debian|suse)
78 80
            echo $instance > $HNAME
79 81
            ;;
80
        redhat|gentoo)
82
        redhat)
81 83
            sed -ie "s/HOSTNAME=${OLD_HNAME}/HOSTNAME=${instance}/" $HNAME
82 84
            ;;
85
        gentoo)
86
            sed -ie "s/HOSTNAME.*/HOSTNAME=\"${OLD_HNAME}}\"/" $HNAME
87
            ;;
83 88
    esac
84 89
else
85 90
    log_error "Cannot rename from $old_name to $instance:"

Also available in: Unified diff