summaryrefslogtreecommitdiff
path: root/yams
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-01-07 12:30:53 -0300
committerRoger Gonzalez <roger@rogs.me>2023-01-07 12:30:53 -0300
commitacce9fd85cc0113ff9f115c0f611c2ca923f13f6 (patch)
tree378752d2b7bf904a8b50ccc6597775b796fcf257 /yams
parenta58eae7304285af86e3f91bc83949da4c15c96a3 (diff)
Fixed the yams sed
Diffstat (limited to 'yams')
-rwxr-xr-xyams35
1 files changed, 29 insertions, 6 deletions
diff --git a/yams b/yams
index cba00c0..0f43ef4 100755
--- a/yams
+++ b/yams
@@ -1,14 +1,37 @@
#!/bin/bash
set -eu
-if [ $1 == "restart" ]; then
- docker-compose -f <filename> stop && docker-compose up -d
+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 [ $1 == "stop" ]; then
- docker-compose -f <filename> stop
+if [ $option == "stop" ]; then
+ $dc stop
+ exit 0
fi
-if [ $1 == "start" ]; then
- docker-compose -f <filename> up -d
+if [ $option == "start" ]; then
+ $dc up -d
+ exit 0
fi