Exit linux scripts on failure

main
root 2 years ago
parent b537b38bb0
commit eb2bf3b996

@ -1,9 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
mkdir thirdparty/opus/build mkdir -p thirdparty/opus/build || exit 1
cd thirdparty/opus/build cd thirdparty/opus/build || exit 1
cmake .. cmake .. || exit 1
cmake --build . cmake --build . || exit 1
cd - 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

@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
systemctl stop flight systemctl stop flight || exit 1
./build_linux_server_release.sh ./build_linux_server_release.sh || exit 1
cp flight.service /etc/systemd/system/ cp flight.service /etc/systemd/system/ || exit 1
systemctl enable flight systemctl enable flight || exit 1
systemctl start flight systemctl start flight || exit 1
systemctl restart flight systemctl restart flight || exit 1

Loading…
Cancel
Save