summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Gonzalez <roger@rogs.me>2023-10-21 16:18:51 -0300
committerRoger Gonzalez <roger@rogs.me>2023-10-21 16:18:51 -0300
commitdbf07bbcb290270401ec0bc069355a278f8f10f4 (patch)
tree43da55a6c627d2bda21c3dbc2947d4de4f63feed
parent6e94df162b9c98da80d1c60c8ccc88151837fb55 (diff)
Testing update functionality
-rwxr-xr-xyams20
1 files changed, 20 insertions, 0 deletions
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 <filename>"
+install_location="<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>;$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