mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Subject: [PATCH] defaultenv: don't overwrite  in config
Date: Sat, 12 May 2012 23:40:12 +0200	[thread overview]
Message-ID: <1336858812-23098-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)

This patch prooved to be useful while working with a colleague on a single
machine. It allows to switch the user without editing /env/config by
just issuing:

	export user=me

. Note, in bash this construct (i.e. an if without body) bails out with:

	Syntax error: "fi" unexpected

but in hush it seems to do the right thing.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 defaultenv/config |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/defaultenv/config b/defaultenv/config
index 3e4c2ee..7b61d29 100644
--- a/defaultenv/config
+++ b/defaultenv/config
@@ -1,7 +1,9 @@
 #!/bin/sh
 
 hostname=FIXME
-#user=
+if [ -z "$user" ]; then
+#	user=
+fi
 
 # Enter MAC address here if not retrieved automatically
 #eth0.ethaddr=de:ad:be:ef:00:00
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2012-05-12 21:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-12 21:40 Uwe Kleine-König [this message]
2012-05-12 21:43 ` Uwe Kleine-König
2012-05-13  9:05 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1336858812-23098-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.trumtrar@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox