From eb2bf3b9960df22a827840931fa860588613ba0d Mon Sep 17 00:00:00 2001 From: root Date: Sun, 18 Dec 2022 18:32:49 -0800 Subject: [PATCH] Exit linux scripts on failure --- build_linux_server_release.sh | 12 ++++++------ linux_server_install.sh | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build_linux_server_release.sh b/build_linux_server_release.sh index cc2f436..97d62cf 100755 --- a/build_linux_server_release.sh +++ b/build_linux_server_release.sh @@ -1,9 +1,9 @@ #!/usr/bin/env bash -mkdir thirdparty/opus/build -cd thirdparty/opus/build -cmake .. -cmake --build . -cd - +mkdir -p thirdparty/opus/build || exit 1 +cd thirdparty/opus/build || exit 1 +cmake .. || exit 1 +cmake --build . || exit 1 +cd - || exit 1 -gcc -o flight_server -Wall -O2 -DNDEBUG -DRELEASE -Ithirdparty -Ithirdparty/opus/include -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread -ldl thirdparty/opus/build/libopus.a +gcc -o flight_server -Wall -O2 -DNDEBUG -DRELEASE -Ithirdparty -Ithirdparty/opus/include -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread -ldl thirdparty/opus/build/libopus.a || exit 1 diff --git a/linux_server_install.sh b/linux_server_install.sh index fe05bd0..0fb5b6d 100755 --- a/linux_server_install.sh +++ b/linux_server_install.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -systemctl stop flight -./build_linux_server_release.sh -cp flight.service /etc/systemd/system/ -systemctl enable flight -systemctl start flight -systemctl restart flight +systemctl stop flight || exit 1 +./build_linux_server_release.sh || exit 1 +cp flight.service /etc/systemd/system/ || exit 1 +systemctl enable flight || exit 1 +systemctl start flight || exit 1 +systemctl restart flight || exit 1