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
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
10#echo "syncing disk"
[13990]11sync
[23201]12#echo""
[10686]13
[23201]14echo "Checking your box type..."
[10686]15if [ "$model" = "" ]; then
[23201]16 echo ""
17 echo "Sorry! This plugin is not available for your $model, because it will not work correctly!"
[10686]18 echo "Aborting installation..."
19 exit 1
20else
[23201]21 echo "Box type $model OK."
[10686]22fi
23
[23201]24echo "Checking swapstick..."
[11214]25if [ ! -d /var/swap/titanskins/ ]; then
[23201]26 echo "----------------------"
27 echo "Swapstick not found..."
28 echo "----------------------"
[10686]29 exit 1
[23201]30else
31 echo "Swapstick found..."
[10686]32fi
[23201]33
[12781]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`
[23201]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!"
[12781]42 exit 1
43 else
[23201]44 echo "OK"
[12781]45 fi
46else
[23201]47 #echo "Syncing disk..."
[12781]48 sync
49fi
[13990]50
[23201]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
[11782]59fi
60
[23201]61rm -rf $plugindir
62echo "Installing $plugin..."
[15994]63
[23201]64exit 0
Note: See TracBrowser for help on using the repository browser.