Permalink
Browse files

Merge pull request #47 from nilbus/exit-status

Return an error exit status from client commands that fail
  • Loading branch information...
zolrath committed Aug 22, 2015
2 parents 115f512 + fee7f48 commit 01c6541f8deceff372711241db2a13f21c4b210c
Showing with 7 additions and 1 deletion.
  1. +7 −1 wemux
8 wemux
@@ -326,9 +326,10 @@ announce_connection() {
[ "$announce_attach" == "true" ] && redirect=`$wemux display-message \
"$username has attached in $connection_type mode." 2>&1`
$attach_commands
status=$?
[ "$announce_attach" == "true" ] && redirect=`$wemux display-message \
"$username has detached." 2>&1`
return 0
return $status
}
# Announces when a user joins/changes their server.
@@ -521,6 +522,7 @@ client_mode() {
$wemux attach -t $server -r
else
echo "No wemux server to mirror on '$server'."
return 126
fi
}
@@ -531,6 +533,7 @@ client_mode() {
$wemux attach -t $server
else
echo "No wemux server to pair with on '$server'."
return 126
fi
else
echo "Pair mode is disabled."
@@ -552,6 +555,7 @@ client_mode() {
$wemux attach -t $client_session
else
echo "No wemux server to go 'rogue' with on '$server'."
return 126
fi
else
echo "Rogue mode is disabled."
@@ -569,6 +573,7 @@ client_mode() {
echo "Logged out of rogue mode on '$server'."
else
echo "No wemux server to log out of on '$server'."
return 126
fi
else
echo "Rogue mode is disabled."
@@ -599,6 +604,7 @@ client_mode() {
announce_connection "mirror" $wemux attach -t $server -r
else
echo "No wemux server to attach to on '$server'"
return 126
fi
}

0 comments on commit 01c6541

Please sign in to comment.