#!/bin/bash
#make by G.R.H

progdir=$(dirname "$0")
if [ -f /mnt/mod/update.dep ]; then
    [[ -f /usr/bin/mpv ]] && (mpv --really-quiet --image-display-duration=3 "${progdir}/res/apps.png")
    tar --no-same-owner -xmf /mnt/mod/update.dep -C /mnt/mmc
    touch /mnt/mmc/update/nokillme
    sync
    [[ -f /usr/bin/mpv ]] && (mpv --really-quiet --image-display-duration=3 "${progdir}/res/ing.png")
    /mnt/mmc/update/update.sh
fi
[[ -f /usr/bin/mpv ]] && (mpv --really-quiet --image-display-duration=3 "${progdir}/res/error.png")
exit 0
