From acce9fd85cc0113ff9f115c0f611c2ca923f13f6 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sat, 7 Jan 2023 12:30:53 -0300 Subject: Fixed the yams sed --- setup.sh | 4 ++-- yams | 35 +++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/setup.sh b/setup.sh index e4b400b..2db2765 100755 --- a/setup.sh +++ b/setup.sh @@ -114,7 +114,7 @@ sed -i -e "s//$pgid/g" $filename sed -i -e "s;;$entertainment_folder;g" $filename # Set yams script -sed -i -e "s//$filename" yams.sh +sed -i -e "s;;$filename;g" yams send_success_message "Everything installed correctly! 🎉" read -p "Do you want to run the script now? [Y/n]: " run_now @@ -123,7 +123,7 @@ run_now=${run_now:-"y"} if [ $run_now == "y" ]; then echo "Running the server..." echo "This is going to take a while..." - ./run.sh $filename + docker-compose -f $filename up -d else echo "Perfect! You can run the server later using the following command:" echo "" 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 stop && docker-compose up -d +dc="docker-compose -f " + +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 stop +if [ $option == "stop" ]; then + $dc stop + exit 0 fi -if [ $1 == "start" ]; then - docker-compose -f up -d +if [ $option == "start" ]; then + $dc up -d + exit 0 fi -- cgit v1.2.3