mirror of
https://github.com/kenzok8/small-package.git
synced 2026-01-14 11:25:06 +08:00
14 lines
326 B
Bash
Executable File
14 lines
326 B
Bash
Executable File
#!/bin/sh
|
|
|
|
CONFIG_NAME='tinyfilemanager'
|
|
|
|
while :; do
|
|
inotifywait -e modify $CONF 2>/dev/null
|
|
|
|
CONFIG="$(sed -En "/^\\\$CONFIG\s*=.*/{s|^.+'(.+)'.*|\1|p}" $CONF)"
|
|
if [ -n "$CONFIG" ]; then
|
|
uci set $CONFIG_NAME.@$TYPEDSECTION[0].defconf="$CONFIG"
|
|
[ -z "$(uci changes $CONFIG_NAME)" ] || uci commit $CONFIG_NAME
|
|
fi
|
|
done
|