summaryrefslogtreecommitdiff
path: root/yams
blob: 0f43ef48f90671148d5022358c2af6af9b307e22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -eu

dc="docker-compose -f <filename>"

option=${1:-"--help"}

help() {
   echo "yams - Yet Another Media Server"
   echo
   echo "Usage: yams [--help|restart|stop|start|status]"
   echo "options:"
   echo "--help     displays this help message"
   echo "restart    restarts yams"
   echo "stop       stops yams"
   echo "start      starts yams"
}

if [ $option == "--help" ]; then
    help
    exit 0
fi

if [ $option == "restart" ]; then
    $dc stop && $dc up -d
    exit 0
fi

if [ $option == "stop" ]; then
    $dc stop
    exit 0
fi

if [ $option == "start" ]; then
    $dc up -d
    exit 0
fi