From 1ca5883d107e491a9b3b5c388840da636a6e99e7 Mon Sep 17 00:00:00 2001 From: Ben the Pyrate Date: Tue, 19 Aug 2014 11:54:40 -0400 Subject: [PATCH] The exit status should indicate whether or not the connection was successful --- cli/wicd-cli.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cli/wicd-cli.py b/cli/wicd-cli.py index 47cdc3e..8c260a6 100755 --- a/cli/wicd-cli.py +++ b/cli/wicd-cli.py @@ -25,6 +25,8 @@ from wicd.translations import _ misc.RenameProcess('wicd-cli') +exit_status = 0 + if getattr(dbus, 'version', (0, 0, 0)) < (0, 80, 0): import dbus.glib else: @@ -278,6 +280,8 @@ if options.connect: print message() last = next_ print "done!" + if status() != u'done': + exit_status = 6 op_performed = True def str_properties(prop): @@ -313,3 +317,5 @@ if options.save and options.network > -1: if not op_performed: print "No operations performed." +sys.exit(exit_status) +