#!/bin/bash

while inotifywait -r -e modify ./; do
    docker-compose -f compose/karmen/docker-compose.yml down
    docker-compose -f compose/karmen/docker-compose.yml up --build -d
    echo "Uploading files to the cloud..."
    sleep 10
    curl -u admin:password http://localhost:8080/remote.php/webdav/Documents/list.tpl.md -X PUT --data-binary @"./generator/generators/list/list.tpl.md"
    curl -u admin:password http://localhost:8080/remote.php/webdav/Documents/reference.odt -X PUT --data-binary @"./generator/generators/list/reference.odt"
done
