[Unit]
Description=Wait on network
After=connman.service
Before=kodi-autostart.service kodi.service
ConditionPathExists=/storage/.cache/openelec/network_wait

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

[Install]
WantedBy=kodi.service
