#!/bin/sh

if [ -s /usr/lib/enigma2/python/Plugins/Extensions/AFNKeyUpdater/scripts/Your-Softcam-Key-Location ]
then
        echo "I found your SoftCam.Key file ;) "
else
        echo
        echo "I can't find your SoftCam.Key please use option 4 of the menu first"
        echo
        exit 0
fi

			while read line
			do
                        sed -i '/AU KEYS/,/AU KEYS end/d' $line
                        echo "########################### AU KEYS #########################" >> $line
                        cat /usr/lib/enigma2/python/Plugins/Extensions/AFNKeyUpdater/.au >> $line
                        echo "########################### AU KEYS end #####################" >> $line
			done < /usr/lib/enigma2/python/Plugins/Extensions/AFNKeyUpdater/scripts/Your-Softcam-Key-Location
                        echo
                        echo AU Keys installed
                        echo The Key update can take up to 20 mins
                        echo 
                        echo PLEASE RESTART OSCAM ALL AU KEYS UPDATED
                        echo

