From dbf07bbcb290270401ec0bc069355a278f8f10f4 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Sat, 21 Oct 2023 16:18:51 -0300 Subject: Testing update functionality --- yams | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/yams b/yams index 7ca1622..1a5163f 100755 --- a/yams +++ b/yams @@ -3,6 +3,7 @@ set -euo pipefail dc="docker-compose -f " +install_location="" option=${1:-"--help"} @@ -17,6 +18,7 @@ help() { echo "start starts yams services" echo "destroy destroy yams services so you can start from scratch" echo "check-vpn checks if the VPN is working as expected" + echo "update updates YAMS } send_success_message() { @@ -81,3 +83,21 @@ if [ $option == "destroy" ]; then echo "\$ yams start" fi fi + +if [ $option == "update" ]; then + echo "Updating YAMS..." + $dc stop + rm -rf /tmp/yams && mkdir /tmp/yams + wget https://gitlab.com/rogs/yams/-/raw/master/docker-compose.example.yaml -O /tmp/yams/docker-compose.example.yml > /dev/null 2>&1 + source $install_location/.env + + filename="$install_location/docker-compose.yaml" + + cp /tmp/yams/docker-compose.example.yml $filename + + + sed -i -e "s;;$MEDIA_SERVICE;g" "$filename" + if [ "$MEDIA_SERVICE" == "plex" ]; then + sed -i -e "s;#network_mode: host # plex;network_mode: host # plex;g" "$filename" + fi +fi -- cgit v1.2.3