Refactored YAMS to literate #59

Merged
rogs merged 32 commits from feature/refactor-to-literate into v2 2023-10-21 19:17:08 -03:00
Showing only changes of commit dbf07bbcb2 - Show all commits

20
yams
View File

@ -3,6 +3,7 @@ set -euo pipefail
dc="docker-compose -f <filename>" dc="docker-compose -f <filename>"
install_location="<install_location>"
option=${1:-"--help"} option=${1:-"--help"}
@ -17,6 +18,7 @@ help() {
echo "start starts yams services" echo "start starts yams services"
echo "destroy destroy yams services so you can start from scratch" echo "destroy destroy yams services so you can start from scratch"
echo "check-vpn checks if the VPN is working as expected" echo "check-vpn checks if the VPN is working as expected"
echo "update updates YAMS
} }
send_success_message() { send_success_message() {
@ -81,3 +83,21 @@ if [ $option == "destroy" ]; then
echo "\$ yams start" echo "\$ yams start"
fi fi
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