2023-04-16 19:02:09 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
EXCLUDE_PATTERN='(^|/)(\.git($|/)|wb-mqtt-mbgate\.conf$|resolv\.conf$)'
|
|
|
|
|
|
|
|
inotifywait -m -r -e close_write,move,create,delete --exclude "$EXCLUDE_PATTERN" --format '%w%f' /mnt/data/etc | while read FILE
|
|
|
|
do
|
2023-04-16 21:46:56 +03:00
|
|
|
echo $(hostname) > /mnt/data/etc/vestasync/hostname
|
2023-04-16 19:02:09 +03:00
|
|
|
export GIT_AUTHOR_NAME="vestasync_wb_$(hostname)_inotify"
|
|
|
|
export GIT_COMMITTER_NAME="vestasync_wb_$(hostname)_inotify"
|
|
|
|
cd /mnt/data/etc/
|
|
|
|
git add .
|
|
|
|
git commit -m "$(date)"
|
|
|
|
git push -u origin master
|
|
|
|
done
|