[Unit]
Description=Wait on network
Requisite=connman.service
After=connman.service
Before=network-online.target
DefaultDependencies=no
Conflicts=shutdown.target
ConditionPathExists=/storage/.cache/libreelec/network_wait

[Service]
Type=oneshot
EnvironmentFile=/storage/.cache/libreelec/network_wait
ExecStartPre=/bin/sh -c 'echo "waiting on Network to come online ... (max. $WAIT_NETWORK_TIME sec.)"'
ExecStart=/usr/sbin/connmand-wait-online --timeout=${WAIT_NETWORK_TIME}
StandardOutput=tty
RemainAfterExit=yes

[Install]
WantedBy=network-online.target
