23 lines
685 B
Diff
23 lines
685 B
Diff
|
From cbfe65c2fe599b7b5eb6a144332e84c2290869ea Mon Sep 17 00:00:00 2001
|
||
|
From: Dennis Schridde <devurandom@gmx.net>
|
||
|
Date: Fri, 17 May 2013 13:54:57 +0200
|
||
|
Subject: [PATCH] [40network] Provide a hostname fallback function, in case
|
||
|
there is no executable of this name
|
||
|
|
||
|
---
|
||
|
modules.d/40network/net-lib.sh | 4 ++++
|
||
|
1 file changed, 4 insertions(+)
|
||
|
|
||
|
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
|
||
|
index f9b461b..d62d5ad 100644
|
||
|
--- a/modules.d/40network/net-lib.sh
|
||
|
+++ b/modules.d/40network/net-lib.sh
|
||
|
@@ -366,3 +366,7 @@ linkup() {
|
||
|
&& wait_for_if_up $1 2>/dev/null
|
||
|
}
|
||
|
|
||
|
+type hostname >/dev/null 2>&1 || \
|
||
|
+hostname() {
|
||
|
+ cat /proc/sys/kernel/hostname
|
||
|
+}
|