[Unit] Description=Watch cosmos.config.json and trigger routes.sh After=network.target [Service] User=ubuntu ExecStart=/bin/bash -c 'while inotifywait -q -e modify /var/lib/cosmos/cosmos.config.json; do $HOME/routes.sh; done' Restart=always RestartSec=5 [Install] WantedBy=multi-user.target