summaryrefslogblamecommitdiff
path: root/mqtt-esp5100-init.d
blob: ea3804aa5edcd71ed821810e0f4d55d2d15ed872 (plain) (tree)


















                                                   
#!/sbin/openrc-run

name="MQTT for ESP-5100"
command="/usr/local/bin/${RC_SVCNAME}"
description="MQTT for ESP-5100"
pidfile="/var/run/${RC_SVCNAME}.pid"
command_args="$ARGS"

depend() {
    use logger dns
    need net
}

start_pre() {
    if ! ip link show can0 | grep -q UP; then
        ip link set can0 up type can bitrate 250000
        ifconfig can0 up
    fi
}