rand256 / valetudo

Valetudo RE - experimental vacuum software, cloud free
Apache License 2.0
667 stars 73 forks source link

Issue with Valetudo.conf #35

Closed onggie closed 4 years ago

onggie commented 4 years ago

Looks like there are a few issues with the conf and won't auto run.

Current config looks like this

#!upstart
description "Valetudo"

start on started rrwatchdoge
stop on stopping rrwatchdoge

oom score 1000

script
    # give roborock software some time to initialize if started at boot or right after them
    wdp=`pidof WatchDoge`
    if [ `cut -d. -f1 /proc/uptime` -lt 300 ]; then
        echo -n "Waiting for 30 sec after boot..."
        sleep 30
        echo " done."
    elif [ -n "$wdp" -a $(date +%s --date="now - `stat -c%X /proc/$wdp` seconds") -lt 60 ]; then
        echo -n "Waiting for 15 sec after watchdoge launch..."
        sleep 15
        echo " done."
    fi
    # check data partition to be mounted before doing anything
    while ! /bin/mountpoint -q /mnt/data
    do
        echo "Data mountpoint isn't ready, can't run yet. Retrying in 5 sec..."
        sleep 5
    done
    # disable core dumps on this system, we're in production
    echo '|/bin/false' > /proc/sys/kernel/core_pattern
    # finally run valetudo
    exec /usr/bin/chrt -i 0 /usr/bin/ionice -c3 /usr/local/bin/valetudo
end script

respawn
respawn limit 10 90
limit as 209715200 209715200

When running init-checkconf to check the file I get;

ERROR: File valetudo.conf: shell syntax invalid in script section: /bin/sh: 8: Syntax error: "elif" unexpected (expecting "then")

onggie commented 4 years ago

Ignore please, for some reason when copy the text out of raw it stuffed the formatting up. Copied over the file and no issues, must have had some hidden indentation issues.