Update inotify to use config file
All checks were successful
continuous-integration/drone/tag Build is passing
All checks were successful
continuous-integration/drone/tag Build is passing
This commit is contained in:
parent
be7c3e63a2
commit
f8b4031aa3
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,5 +1,16 @@
|
||||||
# Change Log
|
# 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
|
## 20200826-1
|
||||||
|
|
||||||
- Initial bring up of the wifi configuration utility
|
- Initial bring up of the wifi configuration utility
|
||||||
|
|
|
@ -7,16 +7,21 @@ import (
|
||||||
|
|
||||||
"github.com/dietsche/rfsnotify"
|
"github.com/dietsche/rfsnotify"
|
||||||
|
|
||||||
|
"git.kemonine.info/PiFrame/config"
|
||||||
"git.kemonine.info/PiFrame/watchdog"
|
"git.kemonine.info/PiFrame/watchdog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CMD_SYSTEMCTL = "/usr/bin/systemctl"
|
CMD_SYSTEMCTL = "/usr/bin/systemctl"
|
||||||
PATH_PICTURES = "/tank/pictures"
|
|
||||||
TIMEOUT = 5 * time.Second
|
TIMEOUT = 5 * time.Second
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
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
|
// Create watchdog timer that restarts pf-ui.service on timeout
|
||||||
watchdog := watchdog.New(TIMEOUT, func() {
|
watchdog := watchdog.New(TIMEOUT, func() {
|
||||||
err := exec.Command(CMD_SYSTEMCTL, "restart", "pf-ui.service").Run()
|
err := exec.Command(CMD_SYSTEMCTL, "restart", "pf-ui.service").Run()
|
||||||
|
|
Loading…
Reference in a new issue