lila/bin/base_script.php
Thibault Duplessis 100d02af8b Emergency fixes
2012-05-29 22:11:50 +02:00

24 lines
480 B
PHP

<?php
$play = "/home/Play21/play";
function show_run($text, $command, $catch = false)
{
echo "\n* $text\n$command\n";
passthru($command, $return);
if (0 !== $return && !$catch) {
echo "\n/!\\ The command returned $return\n";
exit(1);
}
}
function show_run_catch($text, $command)
{
show_run($text, $command, true);
}
function read_arg(array $argv, $index, $default = null)
{
return isset($argv[$index+1]) ? $argv[$index+1] : $default;
}