#!/bin/sh

/etc/init.d/istore boot

TARGET="/www/luci-static/istore/index.js"

if [ -f "$TARGET" ]; then
    sed -i 's/class:"tabs"/class:"cbi-tabmenu"/g' "$TARGET"
fi

if [ -z "`uci -q get istore.istore.hide_docker`" ] && ! which docker >/dev/null; then
    uci -q batch <<-EOF >/dev/null
        set istore.istore.hide_docker=1
        commit istore
EOF
fi

# remove tmp keys that used for self-installation, which is not needed after installation
rm -f /etc/apk/keys/istore-tmp.pem

rm -rf /tmp/luci-indexcache /tmp/luci-modulecache
