Ignore:
Timestamp:
Sep 5, 2013, 1:11:10 AM (13 years ago)
Author:
tobayer
Message:

[titan] tobayer01 skins: optimize control files

File:
1 edited

Legend:

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

    r18447 r23270  
    11#!/bin/sh
    2 #
    3 TMP=/tmp/.titanskin
    4 echo "syncing disk"
    5 sync
    62
    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 ""
    12 if [ "$model" = "" ]; then
    13         echo "Sorry! This Plugin is not available for your $model because it will not work correctly!!!"
     3plugin_size=2300
     4plugin_short="tobayer01"
     5plugin_type="skin"
     6plugin_target="/var/usr/local/share/titan/skin"
     7
     8plugin_dir="$plugin_target/$plugin_short"
     9plugin="$plugin_short $plugin_type"
     10
     11
     12### MAIN ###
     13
     14# Is this check for anything useful???
     15#model=`cat /etc/model`
     16#echo -n "Checking box type..."
     17#if [ "$model" = "" ]; then
     18#       echo "......[FAILED]"
     19#       echo
     20#       echo "Sorry, $plugin is not available for the $model!"
     21#       echo "Aborting installation..."
     22#       exit 1
     23#else
     24#       echo "......[OK]"
     25#fi
     26
     27
     28echo -n "Checking installation directory..."
     29if [ ! -d $plugin_target ]; then
     30        echo "......[FAILED]"
     31        echo
     32        echo "'$plugin_target' not found!"
    1433        echo "Aborting installation..."
    1534        exit 1
    1635else
    17         echo "Boxtype: $model OK"
     36#       echo "......[OK]"
     37        echo
    1838fi
    1939
    20 if [ `df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ]; then
    21         SPACE=`df | grep /dev/mtdblock | grep var | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    22         FREE=`expr $SPACE - 100`
    23         SIZE=1050
    24         echo "checking freespace"
    25         echo package size $SIZE kb
    26         echo freespace size $FREE kb
    27         if  [ "$FREE" -lt "$SIZE" ]; then
    28                 echo "sorry no freespace left on device"
    29                 exit 1
    30         else
    31                 echo ok         
    32         fi
     40
     41sync
     42SPACE=`getfreespace $plugin_target`
     43FREE=`expr $SPACE - 100`
     44echo -n "Checking free space (${plugin_size}/${FREE}kB)..."
     45if [ "$FREE" -lt "$plugin_size" ]; then
     46        echo "......[FAILED]"
     47        echo
     48        echo "Not enough free space in $plugin_target!"
     49        echo "Aborting installation..."
     50        exit 1
    3351else
    34         echo "syncing disk"
    35         sync
     52#       echo "......[OK]"
     53        echo
    3654fi
    3755
    38 buildgroup=`cat /etc/.buildgroup`
    39 echo "checking OS"       
    40 if  [ `cat /etc/motd | grep $buildgroup | grep M | grep rev | wc -l` -eq 0 ]; then               
    41         echo ---------------------------                 
    42         echo DONT USE this IPK Package!!                 
    43         echo ---                 
    44         echo Only for $buildgroup Image!!               
    45         echo ---------------------------                 
    46         exit 1           
    47 fi
    48  
    49 echo "installing tobayer01 skin ..."
     56
     57# Is this check for anything useful???
     58#buildgroup=`cat /etc/.buildgroup`
     59#echo -n "Checking image type..."
     60#if [ `cat /etc/version | grep $buildgroup | wc -l` -eq 0 ]; then
     61#       echo "......[FAILED]"
     62#       echo
     63#       echo "Sorry, $plugin is not available for this image type!"
     64#       echo "Aborting installation..."
     65#       exit 1
     66#else
     67#       echo "......[OK]"
     68#fi
     69
     70
     71rm -rf $plugin_dir
     72
     73#echo -n "Installing $plugin..."
     74#echo "......[OK]"
    5075
    5176exit 0
Note: See TracChangeset for help on using the changeset viewer.