# HG changeset patch # User Hans-G?nter Theisgen # Date 1686062598 -3600 # Node ID f434a75549190a03665ffe7cb8c1e1779f01e13e # Parent 9a679d8916b6e7621432b73881d43c47d005a886 modified ps to work with busybox as well as with procps diff -r 9a679d8916b6 -r f434a7554919 etc/init.d/network.sh --- a/etc/init.d/network.sh Thu Mar 23 17:04:05 2023 +0000 +++ b/etc/init.d/network.sh Tue Jun 06 15:43:18 2023 +0100 @@ -66,10 +66,11 @@ w=="yes"?"wireless":"wired", /start/?"":"-disconnected");}') # FIXME: this valid only for lxde-session - local user="$(ps aux 2>/dev/null | grep [l]xde-session | awk 'END{print $2}')" + local user="$(ps -e -o user,args 2>/dev/null | grep [l]xde-session | sed 's| .*||')" + # works for busybox ps as well as for ps from package procps local rpid='' [ -s "$npid" ] && rpid="-r $(cat $npid)" - su -c "notify-send $rpid -i $icon 'Network' \"$2\"" - $user | tr -c 0-9 '\n' | tail -n1 > $npid + su -c "DISPLAY=\"$DISPLAY\" notify-send $rpid -i $icon 'Network' \"$2\"" - "$user" | tr -c 0-9 '\n' | tail -n1 > $npid } @@ -82,7 +83,8 @@ done # restart if LXPanel running if [ -n "$DISPLAY" ] && [ -n "$(which lxpanelctl)" ]; then - lxpanelctl restart + local user="$(ps -e -o user,args 2>/dev/null | grep [l]xde-session | sed 's| .*||')" + su -c "DISPLAY=\"$DISPLAY\" lxpanelctl restart" - "$user" fi }