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

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

[titan] tobayer01 swapskin: test 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
10#echo "syncing disk"
11sync
12#echo""
13
14echo "Checking your box type..."
15if [ "$model" = "" ]; then
16 echo ""
17 echo "Sorry! This plugin is not available for your $model, because it will not work correctly!"
18 echo "Aborting installation..."
19 exit 1
20else
21 echo "Box type $model OK."
22fi
23
24echo "Checking swapstick..."
25if [ ! -d /var/swap/titanskins/ ]; then
26 echo "----------------------"
27 echo "Swapstick not found..."
28 echo "----------------------"
29 exit 1
30else
31 echo "Swapstick found..."
32fi
33
34if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then
35 SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
36 FREE=`expr $SPACE - 100`
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 #echo "Syncing disk..."
48 sync
49fi
50
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
59fi
60
61rm -rf $plugindir
62echo "Installing $plugin..."
63
64exit 0
Note: See TracBrowser for help on using the repository browser.