Update launcher script with handing of return value
This commit is contained in:
parent
96f5c08c14
commit
96153f8c60
1 changed files with 6 additions and 4 deletions
|
@ -29,14 +29,16 @@ print_usage() if ( @ARGV < 1 or
|
||||||
'map=s' => \$map,
|
'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 "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 "Client requires hostname\n" and exit if $client and not $host;
|
||||||
print "Server requires mapfile\n" and exit if $server and not $map;
|
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;
|
print "Running locally requires mapfile\n" and exit if not $server and not $client and not $map;
|
||||||
|
|
||||||
# Run client, server or local
|
# Run client, server or local
|
||||||
system("ttrts-client $host") if $client and $host;
|
my $res = -1;
|
||||||
system("ttrts-server $map") if $server and $map;
|
$res = system("ttrts-client $host") if $client and $host;
|
||||||
system("ttrts-local $map") if not $server and not $client and $map;
|
$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";
|
return $res
|
Loading…
Add table
Add a link
Reference in a new issue