]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
base-files: ipcalc.sh: get rid of `basename` dependency 23060/head
authorAndre Heider <a.heider@gmail.com>
Thu, 23 Apr 2026 08:38:06 +0000 (10:38 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 24 Apr 2026 00:48:15 +0000 (01:48 +0100)
The netifd/dhcp flow uses this, and as uxc mounts netifd in a
container, this allows not mounting `basename` for just a usage.

References: https://github.com/openwrt/procd/pull/34
Suggested-by: Daniel Golle <daniel@makrotopia.org>
Signed-off-by: Andre Heider <a.heider@gmail.com>
package/base-files/files/bin/ipcalc.sh

index e8c7a07df6e37a44d60c81b2357de5c521e18058..c698224f19f8d6f1dc944f3974015756fb85d556 100755 (executable)
@@ -2,8 +2,6 @@
 
 . /lib/functions/ipv4.sh
 
-PROG="$(basename "$0")"
-
 # wrapper to convert an integer to an address, unless we're using
 # decimal output format.
 # hook for library function
@@ -21,7 +19,7 @@ _ip2str() {
 }
 
 usage() {
-    echo "Usage: $PROG [ -d | -x ] address/prefix [ start limit ]" >&2
+    echo "Usage: ${0##*/} [ -d | -x ] address/prefix [ start limit ]" >&2
     exit 1
 }