From 96153f8c609b4bd9f8b72931ba5300389ac6af9f Mon Sep 17 00:00:00 2001 From: mdiluzio Date: Sat, 10 Jan 2015 17:04:55 +0000 Subject: [PATCH] Update launcher script with handing of return value --- source/launcher/ttrts.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/launcher/ttrts.pl b/source/launcher/ttrts.pl index b757ee9..886fed6 100755 --- a/source/launcher/ttrts.pl +++ b/source/launcher/ttrts.pl @@ -29,14 +29,16 @@ print_usage() if ( @ARGV < 1 or 'map=s' => \$map, ) ); +# Verify we have the right parameters print "Cannot run as both client and server\n" and exit if $client and $server; print "Client requires hostname\n" and exit if $client and not $host; print "Server requires mapfile\n" and exit if $server and not $map; print "Running locally requires mapfile\n" and exit if not $server and not $client and not $map; # Run client, server or local -system("ttrts-client $host") if $client and $host; -system("ttrts-server $map") if $server and $map; -system("ttrts-local $map") if not $server and not $client and $map; +my $res = -1; +$res = system("ttrts-client $host") if $client and $host; +$res = system("ttrts-server $map") if $server and $map; +$res = system("ttrts-local $map") if not $server and not $client and $map; -print "Success!\n"; \ No newline at end of file +return $res \ No newline at end of file