source: ipk/source.sh4/swapnetwork_wlan_300/CONTROL/preinst@ 12491

Last change on this file since 12491 was 11789, checked in by madie, 14 years ago

[ipk] add bildgroup check

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