[Unit]
Description=Kodi user autostart script
Before=kodi.service
After=network-online.target graphical.target

[Service]
Type=oneshot
Environment=HOME=/storage
ExecStart=-/bin/sh -c ". /etc/profile; test -f /storage/.config/autostart.sh && exec /bin/sh /storage/.config/autostart.sh"
ExecStop=-/bin/sh -c ". /etc/profile; test -f /storage/.config/autostop.sh && exec /bin/sh /storage/.config/autostop.sh"
RemainAfterExit=yes
TimeoutStopSec=5min

[Install]
WantedBy=kodi.service
