source: ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst@ 23233

Last change on this file since 23233 was 23202, checked in by tobayer, 13 years ago

[titan] tobayer01 swapskin: continue release/beta handling

File size: 1.5 KB
Line 
1#!/bin/sh
2
3plugin="tobayer01 swapskin"
4plugindir="/var/swap/titanskins/tobayer01"
5pluginsize=2300
6model=`cat /etc/model`
7link=`readlink /var/swap`
8buildgroup=`cat /etc/.buildgroup`
9
10sync
11
12echo "Checking your box type..."
13if [ "$model" = "" ]; then
14 echo ""
15 echo "Sorry! This plugin is not available for your $model, because it will not work correctly!"
16 echo "Aborting installation..."
17 exit 1
18else
19 echo "Box type $model is OK."
20fi
21
22echo ""
23echo "Checking swapstick..."
24if [ ! -d /var/swap/titanskins/ ]; then
25 echo "----------------------"
26 echo "Swapstick not found..."
27 echo "----------------------"
28 exit 1
29else
30 echo "Swapstick is OK."
31fi
32
33if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then
34 SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
35 FREE=`expr $SPACE - 100`
36 echo ""
37 echo "Checking free space..."
38 echo "Package size $pluginsize kb"
39 echo "Free space $FREE kb"
40 if [ "$FREE" -lt "$pluginsize" ]; then
41 echo "Sorry, not enough free space on your device!"
42 exit 1
43 else
44 echo "OK"
45 fi
46else
47 sync
48fi
49
50echo ""
51echo "Checking OS..."
52if [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then
53 echo "---------------------------"
54 echo "Don't use this TPK package!"
55 echo "---"
56 echo "Only for $buildgroup image!"
57 echo "---------------------------"
58 exit 1
59else
60 echo "OS is OK."
61fi
62
63rm -rf $plugindir
64echo ""
65echo "Installing $plugin..."
66
67exit 0
Note: See TracBrowser for help on using the repository browser.