From f9fbf9143a99edf18364e68cde682e440c84f861 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Tue, 30 May 2023 10:59:49 +0200 Subject: liveinit: don't use switch unsupported by busybox cut command Thanks to Richard Hoyle for pointing this out. --- liveinit.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'liveinit.tpl') diff --git a/liveinit.tpl b/liveinit.tpl index f01250f..5d34592 100644 --- a/liveinit.tpl +++ b/liveinit.tpl @@ -195,7 +195,7 @@ for ARG in $(cat /proc/cmdline); do # generic syntax: hostname=newname[,qualifier] LIVE_HOSTNAME=$(echo $ARG | cut -f2 -d= | cut -f1 -d,) # Allow for the user to (mistakenly) add a domain component: - if [ $(echo $LIVE_HOSTNAME |cut -d. -f1- --output-delimiter ' '|wc -w) -gt 1 ]; then + if [ -n "$(echo "$LIVE_HOSTNAME". |cut -d. -f2-)" ]; then LIVE_DOMAIN=$(echo $LIVE_HOSTNAME |cut -d. -f2-) LIVE_HOSTNAME=$(echo $LIVE_HOSTNAME |cut -d. -f1) fi -- cgit v1.2.3