hotfix restart exit code
This commit is contained in:
parent
e6a835d552
commit
d32a54d50b
|
|
@ -119,7 +119,7 @@ public class App implements Context, Closeable {
|
||||||
.availableComponentClasses(List.of(FRR.class, OVPN.class, TDNS.class)).build())) {
|
.availableComponentClasses(List.of(FRR.class, OVPN.class, TDNS.class)).build())) {
|
||||||
Wait.when(app.running::get);
|
Wait.when(app.running::get);
|
||||||
if (app.shouldRestart.get()) {
|
if (app.shouldRestart.get()) {
|
||||||
System.exit(303);
|
System.exit(42);
|
||||||
} else {
|
} else {
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,13 +141,13 @@ run_java() {
|
||||||
java -jar "$LIBRARY/$VER.pfapp" -c="$CFGPATH" -l="$LIBRARY" -r="$REPO_URL"
|
java -jar "$LIBRARY/$VER.pfapp" -c="$CFGPATH" -l="$LIBRARY" -r="$REPO_URL"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Запускаем Java с возможностью перезапуска при коде возврата 303
|
# Запускаем Java с возможностью перезапуска при коде возврата 42
|
||||||
while true; do
|
while true; do
|
||||||
run_java
|
run_java
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
|
|
||||||
if [ $EXIT_CODE -eq 303 ]; then
|
if [ $EXIT_CODE -eq 42 ]; then
|
||||||
echo "Restarting application (exit code 303)..."
|
echo "Restarting application (exit code 42)..."
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
exit $EXIT_CODE
|
exit $EXIT_CODE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue