[Unit]
Description=XBMC clean debug logs
ConditionKernelCommandLine=!debugging
ConditionPathExists=!/storage/.cache/debug.openelec
Before=xbmc.service

[Service]
Type=oneshot
ExecStart=-/bin/sh -c 'rm -rf /storage/.xbmc/userdata/addon_data/*/*.log /storage/.xbmc/userdata/addon_data/*/log/*'
RemainAfterExit=yes

[Install]
WantedBy=xbmc.service
