chiark / gitweb /
libvolume_id: recognize swap partitions with a tuxonice hibernate image
[elogind.git] / extras / rule_generator / write_net_rules
index b25ecfd8069e7671b68c27540dbfd99643dec1b3..322398bce4b3b277a8910df2e1f32e10a7a6c134 100644 (file)
@@ -88,9 +88,13 @@ fi
 
 if [ -z "$match" ]; then
        echo "missing valid match" >&2
+       unlock_rules_file
        exit 1
 fi
 
+basename=${INTERFACE%%[0-9]*}
+match="$match, KERNEL==\"$basename*\""
+
 if [ "$INTERFACE_NAME" ]; then
        # external tools may request a custom name
        COMMENT="$COMMENT (custom name provided by external tool)"
@@ -100,7 +104,6 @@ if [ "$INTERFACE_NAME" ]; then
        fi
 else
        # if a rule using the current name already exists, find a new name
-       basename=${INTERFACE%%[0-9]*}
        if interface_name_taken; then
                INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
                echo "INTERFACE_NEW=$INTERFACE"