File size: 345 Bytes
c35cd37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Usage: svc service [command]
# Example: svc app ps aux

# Validate arguments
if [[ $# -lt 1 ]]; then
    echo "Usage: svc service [command]"
    exit 1
fi

# Service
case $1 in
    *)
        SVC=
        CMD=
        ;;
esac

CMD_ARGS="${@:2}"
if [[ -z $CMD_ARGS ]]; then
    CMD_ARGS="$CMD"
fi
docker compose exec $SVC $CMD_ARGS