Wrap the server operations in a single 'server' command. This will help manage the underlying engine better in the future

This commit is contained in:
cmdr2
2022-08-26 19:33:32 +05:30
parent 716ba93787
commit 3bcde36821
2 changed files with 29 additions and 4 deletions

25
server Normal file
View File

@ -0,0 +1,25 @@
#!/bin/bash
CMD="$1"
if [ -z "$1" ]; then
CMD="start"
fi
start_server() {
docker-compose up &
}
stop_server() {
docker-compose down
}
if [ "$CMD" == "start" ]; then
start_server
elif [ "$CMD" == "stop" ]; then
stop_server
elif [ "$CMD" == "restart" ]; then
stop_server
start_server
else
echo "Unknown option: $1 (Expected start or stop)"
fi