source: ipk/source/players_mediaplayermod_2_5/CONTROL/preinst@ 3680

Last change on this file since 3680 was 3680, checked in by civer, 16 years ago

[IPKs /preinst]

  • added boxtype check to more IPKs
File size: 1.5 KB
Line 
1#!/bin/sh
2#
3TMP=/tmp/.mediaplayer
4PLUGINDIR=/usr/lib/enigma2/python/Plugins/Extensions/MediaPlayer
5echo "syncing disk"
6sync
7
8model=`cat /etc/model`
9echo""
10echo "Checking your Boxtype...."
11echo "Some Plugins will not work correctly on your $model!"
12echo ""
13if [ "$model" = "" ]; then
14 echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
15 echo "Aborting installation..."
16 exit 1
17else
18 echo "Boxtype: $model OK"
19fi
20
21if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
22 SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
23 FREE=`expr $SPACE - 100`
24 SIZE=70
25 MIN=0
26 echo "checking freespace"
27 if [ -e $PLUGINDIR ]; then
28 SKIP=`du $PLUGINDIR | cut -d / -f1 | tail -n1`
29 echo skipped mediaplayer
30 MIN=`expr $MIN + $SKIP`
31 fi
32 echo packege size $SIZE kb
33 echo package skiped $MIN kb
34 SIZEEND=`expr $SIZE - $MIN`
35 echo package install $SIZEEND kb
36 echo freespace size $FREE kb
37 if [ "$FREE" -lt "$SIZEEND" ]; then
38 echo "sorry no freespace left on device"
39 exit 1
40 else
41 echo ok
42 fi
43fi
44echo "installing MediaPlayer ..."
45echo "checking OS"
46if [ `cat /etc/motd | grep AAF | grep M | grep rev | wc -l` -eq 0 ]; then
47 echo ---------------------------
48 echo DONT USE this IPK Package!!
49 echo ---
50 echo Only for AAF Image!!
51 echo ---------------------------
52 exit 1
53fi
54
55if [ -e $PLUGINDIR ]; then
56 echo remove installed mediaplayer
57 rm -r $PLUGINDIR > /dev/null 2>&1
58 echo you must restart Gui before installing!!
59fi
60
61exit 0
Note: See TracBrowser for help on using the repository browser.