]> git.ipfire.org Git - people/arne_f/network.git/commitdiff
network: Speedup function device_hash.
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Jun 2010 22:11:41 +0000 (00:11 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Jun 2010 22:11:41 +0000 (00:11 +0200)
functions.device

index 102c5ceaa494ef5af515f4dea94f62a3a086eebf..3fe531ffbdced86d24bc6cc9e1d8bfbbfc28f481 100644 (file)
@@ -293,7 +293,11 @@ function device_rename() {
 function device_hash() {
        local device=${1}
 
-       macify ${device} | tr -d ':'
+       # Get mac address of device and remove all colons (:)
+       # that will result in a hash.
+       device=$(macify ${device})
+
+       echo "${device//:/}"
 }
 
 # Give the device a new name