[Unit]
Description=Connection service
DefaultDependencies=false
Conflicts=shutdown.target
Before=network.target multi-user.target shutdown.target
After=dbus.service
Wants=network.target

[Service]
Type=dbus
BusName=net.connman
Restart=on-failure
EnvironmentFile=-/run/libreelec/debug/connman.conf
ExecStartPre=-/bin/sh -c "echo -e 'nameserver 8.8.8.8\nnameserver 8.8.4.4' > /etc/resolv.conf"
ExecStartPre=-/bin/sh -c "cat /storage/.cache/hostname > /proc/sys/kernel/hostname"
ExecStartPre=-/bin/sh -c "cat /storage/.config/hosts.conf > /etc/hosts"
ExecStartPre=/sbin/ifconfig lo 127.0.0.1 netmask 255.0.0.0 up
ExecStart=/bin/sh -c ". /usr/lib/connman/connman-setup; exec /usr/sbin/connmand -nr $CONNMAN_MAIN $CONNMAN_DEBUG"
StandardOutput=null
RestartSec=2
StartLimitInterval=0

[Install]
WantedBy=multi-user.target
