When running the command sed provided by toybox, the expression
[^[:cntrl:]] is not understood, what forbids to detect DBUS and
cause further errors.
This patch removes this expression.
Change-Id: If30543fadddf8b6811e14b548a747be99612894b
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then
systemd_pid=$(pgrep -U $UID systemd | head -1)
if [[ -n "$systemd_pid" ]]; then
- val=$(sed '/\<DBUS_SESSION_BUS_ADDRESS=/!d ; s/.*\<DBUS_SESSION_BUS_ADDRESS=\([^[:cntrl:]]*\).*/\1/' /proc/${systemd_pid}/environ)
+ val=$(tr '\0' '\n' < /proc/${systemd_pid}/environ | sed '/^DBUS_SESSION_BUS_ADDRESS=/!d ; s/[^=]*=//')
[[ -n "$val" ]] && export DBUS_SESSION_BUS_ADDRESS=$val
fi
fi