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
RevLine 
[10686]1#!/bin/sh
[23201]2
3plugin="tobayer01 swapskin"
4plugindir="/var/swap/titanskins/tobayer01"
5pluginsize=2300
6model=`cat /etc/model`
7link=`readlink /var/swap`
8buildgroup=`cat /etc/.buildgroup`
9
[13990]10sync
[10686]11
[23201]12echo "Checking your box type..."
[10686]13if [ "$model" = "" ]; then
[23201]14 echo ""
15 echo "Sorry! This plugin is not available for your $model, because it will not work correctly!"
[10686]16 echo "Aborting installation..."
17 exit 1
18else
[23202]19 echo "Box type $model is OK."
[10686]20fi
21
[23202]22echo ""
[23201]23echo "Checking swapstick..."
[11214]24if [ ! -d /var/swap/titanskins/ ]; then
[23201]25 echo "----------------------"
26 echo "Swapstick not found..."
27 echo "----------------------"
[10686]28 exit 1
[23201]29else
[23202]30 echo "Swapstick is OK."
[10686]31fi
[23201]32
[12781]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`
[23202]36 echo ""
[23201]37 echo "Checking free space..."
38 echo "Package size $pluginsize kb"
39 echo "Free space $FREE kb"
[23202]40 if [ "$FREE" -lt "$pluginsize" ]; then
[23201]41 echo "Sorry, not enough free space on your device!"
[12781]42 exit 1
43 else
[23201]44 echo "OK"
[12781]45 fi
46else
47 sync
48fi
[13990]49
[23202]50echo ""
51echo "Checking OS..."
[23201]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
[23202]59else
60 echo "OS is OK."
[11782]61fi
62
[23201]63rm -rf $plugindir
[23202]64echo ""
[23201]65echo "Installing $plugin..."
[15994]66
[23201]67exit 0
Note: See TracBrowser for help on using the repository browser.