Ignore:
Timestamp:
Sep 2, 2013, 12:02:32 AM (13 years ago)
Author:
tobayer
Message:

[titan] tobayer01 swapskin: test release/beta handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ipk/source.sh4/titanswapskins_tobayer01/CONTROL/preinst

    r15994 r23201  
    11#!/bin/sh
    2 #
    3 TMP=/tmp/.titanskin
    4 echo "syncing disk"
     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"
    511sync
     12#echo""
    613
    7 model=`cat /etc/model`
    8 echo""
    9 echo "Checking your Boxtype...."
    10 echo "Some Plugins will not work correctly on your $model!"
    11 echo ""
     14echo "Checking your box type..."
    1215if [ "$model" = "" ]; then
    13         echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
     16        echo ""
     17        echo "Sorry! This plugin is not available for your $model, because it will not work correctly!"
    1418        echo "Aborting installation..."
    1519        exit 1
    1620else
    17         echo "Boxtype: $model OK"
     21        echo "Box type $model OK."
    1822fi
    1923
    20 echo "checking swapstick"
     24echo "Checking swapstick..."
    2125if [ ! -d /var/swap/titanskins/ ]; then
    22   echo "--------------------------"
    23         echo "no swapstick found...."
    24         echo "--------------------------"
     26        echo "----------------------"
     27        echo "Swapstick not found..."
     28        echo "----------------------"
    2529        exit 1
     30else
     31        echo "Swapstick found..."
    2632fi
    27 echo "swapstick found...."
    28 link=`readlink /var/swap`
     33
    2934if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then
    3035        SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    3136        FREE=`expr $SPACE - 100`
    32         SIZE=1050
    33         echo "checking freespace"
    34         echo package size $SIZE kb
    35         echo freespace size $FREE kb
    36         if  [ "$FREE" -lt "$SIZE" ]; then
    37                 echo "sorry no freespace left on device"
     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!"
    3842                exit 1
    3943        else
    40                 echo ok         
     44                echo "OK"
    4145        fi
    4246else
    43         echo "syncing disk"
     47        #echo "Syncing disk..."
    4448        sync
    4549fi
    4650
    47 buildgroup=`cat /etc/.buildgroup`
    48 echo "checking OS"       
    49 if  [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then               
    50         echo ---------------------------                 
    51         echo DONT USE this IPK Package!!                 
    52         echo ---                 
    53         echo Only for $buildgroup Image!!               
    54         echo ---------------------------                 
    55         exit 1           
     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
    5659fi
    5760
    58 rm -rf /var/swap/titanskins/tobayer01
    59 
    60 echo "installing tobayer01 skin to swapstick..."
     61rm -rf $plugindir
     62echo "Installing $plugin..."
    6163
    6264exit 0
Note: See TracChangeset for help on using the changeset viewer.