source: ipk/source/system_tun_ufs910/CONTROL/preinst@ 17841

Last change on this file since 17841 was 11794, checked in by madie, 14 years ago

[ipk] add buildgroup check

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/sh
2#
3TMP=/tmp/.tun
4echo "syncing disk"
5sync
6
7model=`cat /etc/model`
8echo""
9echo "Checking your Boxtype...."
10echo "Some Plugins will not work correctly on your $model!"
11echo ""
12if [ "$model" != "ufs910" ]; then
13 echo "Sorry! This Modul is not for your $model !! It will not work correctly !!"
14 echo "Aborting installation..."
15 exit 1
16else
17 echo "Boxtype: $model OK"
18fi
19
20if [ -e /lib/modules/tun.ko ]; then
21 echo --------------------------
22 echo tun.ko allready installed !!
23 echo --------------------------
24 exit 1
25fi
26if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1 | wc -l` -eq 1 ]; then
27 SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | tail -n1`
28 FREE=`expr $SPACE - 100`
29 SIZE=12
30 echo "check freespace"
31 echo packege size $SIZE kb
32 echo freespace size $FREE kb
33 if [ "$FREE" -lt "$SIZE" ]; then
34 echo "sorry no freespace on device"
35 exit 1
36 else
37 echo ok
38 fi
39fi
40echo "install tun.ko ..."
41buildgroup=`cat /etc/.buildgroup`
42echo "checking OS"
43if [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then
44 echo ---------------------------
45 echo DONT USE this IPK Package!!
46 echo ---
47 echo Only for $buildgroup Image!!
48 echo ---------------------------
49 exit 1
50fi
51exit 0
Note: See TracBrowser for help on using the repository browser.