Java
- 12 ответов
- 0 вопросов
5
Вклад в тег
#!/usr/bin/env bash
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
APP_HOME=$(dirname "$(realpath "$0")")
APP_PID=$(<"$APP_HOME/app.pid")
if ps -p $APP_PID > /dev/null
then
echo "Failed to start, service already started!"
exit 1
fi
nohup java -jar -Dfile.ecoding=UTF-8 "$APP_HOME/app.jar" > "$APP_HOME/app.log" 2>&1 &
APP_PID=$!
echo $APP_PID > "$APP_HOME/app.pid"
echo "App has been started, pid = $APP_PID."
#!/usr/bin/env bash
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
APP_HOME=$(dirname "$(realpath "$0")")
APP_PID=$(<"$APP_HOME/app.pid")
if ps -p $APP_PID > /dev/null
then
echo "Shutdown app with pid = $APP_PID ..."
kill -15 "$APP_PID"
while ps -p $APP_PID > /dev/null
do
echo "Waiting ..."
sleep 0.3
done
echo "Done!"
else
echo "App is not running."
fi
$code = '1 + 2)';
$parser = new PHPParser_Parser(new PHPParser_Lexer);
try {
$stmts = $parser->parse($code);
} catch (PHPParser_Error $e) {
echo 'Parse Error: ', $e->getMessage();
}