Exit linux scripts on failure

main
root 2 years ago
parent b537b38bb0
commit eb2bf3b996

@ -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

@ -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

Loading…
Cancel
Save