commit 303a8deede024fc9cc26e21a84583ee0671410e7
parent c38ab50f299512cb4cb80518262bdacaf8d0d3e5
Author: Morel BĂ©renger <berengermorel76@gmail.com>
Date: Thu, 5 Nov 2020 18:01:25 +0100
adds udhcpc and scripts by default
Diffstat:
4 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/templates/generic/packages/udhcpc.list b/templates/generic/packages/udhcpc.list
@@ -0,0 +1 @@
+udhcpc,
diff --git a/templates/generic/root/etc/runit/log.run b/templates/generic/root/etc/runit/log.run
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+SVLOG="$(basename $(dirname $(pwd)))"
+LOG_PATH="/var/log/$SVLOG"
+install -d -m 0750 -o root -g adm "$LOG_PATH"
+exec svlogd -tt "$LOG_PATH"
diff --git a/templates/generic/root/etc/sv/udhcpc/log/run b/templates/generic/root/etc/sv/udhcpc/log/run
@@ -0,0 +1 @@
+/etc/runit/log.run+
\ No newline at end of file
diff --git a/templates/generic/root/etc/sv/udhcpc/run b/templates/generic/root/etc/sv/udhcpc/run
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+set -xe
+exec 2>&1
+
+echo "Starting dhcp client on $(basename $(pwd))..."
+
+IFACE="$(basename $(pwd))"
+
+exec udhcpc -i ${IFACE} -f -R -n