| 1 | #!/bin/sh
|
|---|
| 2 | #
|
|---|
| 3 | TMP=/tmp/.set
|
|---|
| 4 |
|
|---|
| 5 | model=`cat /etc/model`
|
|---|
| 6 | echo""
|
|---|
| 7 | echo "Checking your Boxtype...."
|
|---|
| 8 | echo "Some Plugins will not work correctly on your $model!"
|
|---|
| 9 | echo ""
|
|---|
| 10 | if [ "$model" = "" ]; then
|
|---|
| 11 | echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
|
|---|
| 12 | echo "Aborting installation..."
|
|---|
| 13 | exit 1
|
|---|
| 14 | else
|
|---|
| 15 | echo "Boxtype: $model OK"
|
|---|
| 16 | fi
|
|---|
| 17 |
|
|---|
| 18 | echo "installing settings ..."
|
|---|
| 19 | buildgroup=`cat /etc/.buildgroup`
|
|---|
| 20 | echo "checking OS"
|
|---|
| 21 | if [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then
|
|---|
| 22 | echo ---------------------------
|
|---|
| 23 | echo DONT USE this IPK Package!!
|
|---|
| 24 | echo ---
|
|---|
| 25 | echo Only for $buildgroup Image!!
|
|---|
| 26 | echo ---------------------------
|
|---|
| 27 | exit 1
|
|---|
| 28 | fi
|
|---|
| 29 |
|
|---|
| 30 | if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
|
|---|
| 31 | SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
|
|---|
| 32 | FREE=`expr $SPACE - 100`
|
|---|
| 33 | SIZE=508
|
|---|
| 34 | echo "checking freespace"
|
|---|
| 35 | echo packege size $SIZE kb
|
|---|
| 36 | echo freespace size $FREE kb
|
|---|
| 37 | if [ "$FREE" -lt "$SIZE" ]; then
|
|---|
| 38 | echo "sorry no freespace left on device"
|
|---|
| 39 | exit 1
|
|---|
| 40 | else
|
|---|
| 41 | echo ok
|
|---|
| 42 | fi
|
|---|
| 43 | else
|
|---|
| 44 | echo "syncing disk"
|
|---|
| 45 | sync
|
|---|
| 46 | fi
|
|---|
| 47 |
|
|---|
| 48 | if [ -e /tmp/.ipkg_upgrade_start ];then
|
|---|
| 49 | echo "ipkg upgrade skip settings"
|
|---|
| 50 | exit 1
|
|---|
| 51 | fi
|
|---|
| 52 |
|
|---|
| 53 | #echo "remove /var/etc/titan/bouquets.*"
|
|---|
| 54 | #rm -rf /var/etc/titan/bouquets.* > /dev/null 2>&1
|
|---|
| 55 | #echo "remove /var/etc/titan/channel"
|
|---|
| 56 | #rm -rf /var/etc/titan/channel > /dev/null 2>&1
|
|---|
| 57 | #echo "remove /var/etc/titan/provider"
|
|---|
| 58 | #rm -rf /var/etc/titan/provider > /dev/null 2>&1
|
|---|
| 59 | #echo "remove /var/etc/titan/satellites"
|
|---|
| 60 | #rm -rf /var/etc/titan/satellites > /dev/null 2>&1
|
|---|
| 61 | #echo "remove /var/etc/titan/transponder"
|
|---|
| 62 | #rm -rf /var/etc/titan/transponder > /dev/null 2>&1
|
|---|
| 63 | cp /var/etc/titan/bouquets.cfg /tmp/bouquets.cfg
|
|---|
| 64 |
|
|---|
| 65 | exit 0
|
|---|