Even though iproute2 is Priority: important, busybox is more common according 
to https://popcon.debian.org/by_inst.gz, probably due to initramfs-tools 
Recommends: busybox.
---
 auto-apt-proxy   |  2 ++
 debian/changelog | 10 ++++++++++
 debian/control   |  2 +-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/auto-apt-proxy b/auto-apt-proxy
index d553abf..889b704 100755
--- a/auto-apt-proxy
+++ b/auto-apt-proxy
@@ -49,6 +49,8 @@ detect_approx() {
 detect() {
   if command -v ip >/dev/null; then
     gateway=$(ip route | awk '/default/ { print($3) }')
+  elif busybox ip >/dev/null 2>&1; then
+    gateway=$(busybox ip route | awk '/default/ { print($3) }')
   else
     gateway=''
   fi
diff --git a/debian/changelog b/debian/changelog
index 2c2b160..ddcf598 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+auto-apt-proxy (11+nmu1) UNRELEASED; urgency=medium
+
+  * Try "busybox ip route" when "ip route" is not available.
+
+    Even though iproute2 is Priority: important, busybox is more common
+    according to https://popcon.debian.org/by_inst.gz, probably due to
+    initramfs-tools Recommends: busybox.
+
+ -- Trent W. Buck <trentb...@gmail.com>  Mon, 26 Aug 2019 13:31:23 +1000
+
 auto-apt-proxy (11) unstable; urgency=medium
 
   * Replace `which` with `command -v`
diff --git a/debian/control b/debian/control
index 869975d..7755a21 100644
--- a/debian/control
+++ b/debian/control
@@ -13,7 +13,7 @@ Rules-Requires-Root: no
 
 Package: auto-apt-proxy
 Architecture: all
-Recommends: iproute2,
+Recommends: iproute2 | busybox,
 Depends: apt,
          ${misc:Depends},
          ${shlibs:Depends},
-- 
2.20.1

Reply via email to