lcd4linux: Possibility added that the config can also be loaded from /tmp
[feed/packages.git] / utils / lcd4linux / files / lcd4linux.init
index a5e6a9db45340bcaa82fc90ae437fc02f27c5722..3c743b04750a6547c8084f66d1b62fb0e4fe08b6 100644 (file)
@@ -5,10 +5,19 @@ START=98
 USE_PROCD=1
 
 PROG="/usr/bin/lcd4linux"
-CONFIGFILE="/etc/lcd4linux.conf"
+STATIC_CONFIG="/etc/lcd4linux.conf"
+DYNAMIC_CONFIG="/tmp/lcd4linux.conf"
 
 start_service() {
-       [ -f /etc/lcd4linux.conf ] || return 1
+       if [ -f "$DYNAMIC_CONFIG" ]; then
+               CONFIGFILE="$DYNAMIC_CONFIG"
+       elif [ -f "$STATIC_CONFIG" ]; then
+               CONFIGFILE="$STATIC_CONFIG"
+       else
+               echo "No config found"
+               return 1
+       fi
+
        procd_open_instance
        procd_set_param command "$PROG"
        procd_append_param command -F