Update inotify to use config file
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
KemoNine 2020-09-05 16:04:43 -04:00
parent be7c3e63a2
commit f8b4031aa3
2 changed files with 17 additions and 1 deletions

View file

@ -1,5 +1,16 @@
# Change Log
## 20200905-3
- Update inotify to use configured path for albums instead of being hard coded
## 20200827-1 through 20200905-2
- Full bring up of main config UI
- Additional 'advanced' configuration available via config file
- Fan management daemon
- inotify dameon for watching the main photos storage for changes and restarting slideshow as appropriate
## 20200826-1
- Initial bring up of the wifi configuration utility

View file

@ -7,16 +7,21 @@ import (
"github.com/dietsche/rfsnotify"
"git.kemonine.info/PiFrame/config"
"git.kemonine.info/PiFrame/watchdog"
)
const (
CMD_SYSTEMCTL = "/usr/bin/systemctl"
PATH_PICTURES = "/tank/pictures"
TIMEOUT = 5 * time.Second
)
func main() {
// Load the config file
pfConfig, _ := config.LoadConfig()
PATH_PICTURES := pfConfig.String(config.CONFIG_KEY_ALBUMS_ROOT)
// Create watchdog timer that restarts pf-ui.service on timeout
watchdog := watchdog.New(TIMEOUT, func() {
err := exec.Command(CMD_SYSTEMCTL, "restart", "pf-ui.service").Run()