You are not logged in.

#1 2010-05-22 13:59:23

tsaxi
Member
Registered: 2010-05-22
Posts: 1

Network Manager Dispatcher returns error code 1 on tested scripts

I'm trying to write a simple script to test the network manager dispatcher but while it's working when I manually launch the script, the nm dispatcher print "nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/start_dropbox.sh' exited with error status 1" into the logs.

#!/bin/sh

IF=$1
STATUS=$2

/bin/su USERNAME -c "/usr/bin/notify-send lol woot"

exit $?

I tried using absolute paths, just the commands, running with sudo(although the scripts should be run as root) and without su. I tested the script as root and as a simple user using a terminal and it works just fine every time.
echo seems to work fine as I don't get any errors in the logs, but that way I can't see what's inside $1 and $2 when the dispatcher calls the script and I can't think of any way to debug the script which doesn't involve notify-send.

I'm sure I'm missing something very simple here, but I can't see it myself and searching google and the arch forums hasn't helped me any.

Offline

Board footer

Powered by FluxBB