X-Git-Url: http://git.ipfire.org/?p=people%2Farne_f%2Fnetwork.git;a=blobdiff_plain;f=functions.device;fp=functions.device;h=40e8eb4415c0d0e0892aba6d90001fd18c193ad3;hp=d0ab0ce36085c60146637ee40c92a678c03edeb4;hb=1578dae929cd6e4fe51418e2180cd478fda938dc;hpb=d76f51071530b7603146051648d060ba1554f1bc diff --git a/functions.device b/functions.device index d0ab0ce3..40e8eb44 100644 --- a/functions.device +++ b/functions.device @@ -292,25 +292,6 @@ function device_is_used() { return ${EXIT_ERROR} } -# XXX to be removed I think -function device_get_free() { - local destination=${1} - - # Replace + by a valid number - if grep -q "+$" <<<${destination}; then - local number=0 - destination=$(sed -e "s/+//" <<<$destination) - while [ "${number}" -le "100" ]; do - if ! device_exists "${destination}${number}"; then - destination="${destination}${number}" - break - fi - number=$(($number + 1)) - done - fi - echo "${destination}" -} - function device_hash() { local device=${1} @@ -324,7 +305,7 @@ function device_hash() { # Give the device a new name function device_set_name() { local source=$1 - local destination=$(device_get_free ${2}) + local destination=${2} # Check if devices exists if ! device_exists ${source} || device_exists ${destination}; then