# HG changeset patch # User Aleksej Bobylev # Date 1464000307 -10800 # Node ID 2a9569d6dbc764f64963ee83ed33ddbc06471ce9 # Parent 018eeb31a351af2e394655395b84f6ddf3d86d19 network.sh: fix errors in boot log: not even try to show notifications while Xorg is not running diff -r 018eeb31a351 -r 2a9569d6dbc7 etc/init.d/network.sh --- a/etc/init.d/network.sh Sat May 21 17:20:19 2016 +0200 +++ b/etc/init.d/network.sh Mon May 23 13:45:07 2016 +0300 @@ -8,7 +8,7 @@ . /etc/init.d/rc.functions CONF="${2:-/etc/network.conf}" -echo "Loading network settings from $CONF" +[ "$1" != 'netapplet' ] && echo "Loading network settings from $CONF" . "$CONF" @@ -21,7 +21,7 @@ interface="$INTERFACE" fi - for i in $(find ${XDG_CONFIG_HOME:-$HOME/.config}/lxpanel -name panel 2> /dev/null); do + for i in $(find ${XDG_CONFIG_HOME:-$HOME/.config}/lxpanel -name panel 2>/dev/null); do fgrep -q netstatus "$i" || continue sed -i '/iface/s|=.*$|='$interface'|' "$i" done @@ -58,11 +58,12 @@ # Freedesktop notification notification() { + ps aux 2>/dev/null | grep -q [X]org || return # FIXME: this valid only for lxde-session - local user="$(ps aux | grep [l]xde-session | awk 'END{print $2}')" + local user="$(ps aux 2>/dev/null | grep [l]xde-session | awk 'END{print $2}')" local icon="$1" rpid='' [ -s "$npid" ] && rpid="-r $(cat $npid)" - which notify-send > /dev/null && + which notify-send >/dev/null && su -c "notify-send $rpid -p -i $icon 'Network' \"$2\"" - $user | tail -n1 > $npid }