Ignore:
Timestamp:
Sep 4, 2013, 12:34:44 AM (13 years ago)
Author:
tobayer
Message:

[titan] tobayer01 swapskin: optimize control files

File:
1 edited

Legend:

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

    r23203 r23247  
    22
    33releaseversion=22775
    4 plugin="tobayer01 swapskin"
    5 plugindir="/var/swap/titanskins/tobayer01"
     4plugin_short="tobayer01"
     5plugin_type="swapskin"
     6plugin_target="/var/swap/titanskins"
     7
     8plugin_dir="$plugin_target/$plugin_short"
     9plugin="$plugin_short $plugin_type"
     10
    611imageversion=`cat /etc/version | cut -d "_" -f2 | sed 's/M//'`;
    7 link=`readlink /var/swap`
    812
    9 if [ `df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1 | wc -l` -eq 1 ] && [ $link = "/mnt/swapextensions" ]; then
    10         SPACE=`df | grep /dev/mtdblock | grep mnt | sed 's/ \+/ /g' | cut -d ' ' -f4 | head -n1`
    11         FREE=`expr $SPACE - 100`
    12         echo "New free space: $FREE kb"
    13 else
    14         sync
    15 fi
     13
     14### FUNCTIONS ###
     15
     16RES_COL=60                                                                      # column number to place the status message
     17MOVE_TO_COL="echo -en \\033[${RES_COL}G"        # command to move to the configured column number
     18
     19echo_success() {                                                        # function to print the SUCCESS status
     20        $MOVE_TO_COL; echo -n "[  OK  ]"; echo
     21}
     22
     23echo_failure() {
     24        $MOVE_TO_COL; echo -n "[FAILED]"; echo  # function to print the FAILED status message
     25}
     26
     27
     28
     29### MAIN ###
     30
     31sync
     32SPACE=`getfreespace $plugin_target`
     33FREE=`expr $SPACE - 100`
     34echo
     35echo "New free space: $FREE kB"
     36
    1637
    1738if [ "$imageversion" -gt "$releaseversion" ]; then
    1839        echo "Successfully installed $plugin (non-release version)."
    1940        # ==> rm skin_release.xml
    20         rm $plugindir/skin_release.xml
     41        rm $plugin_dir/skin_release.xml
    2142else
    2243        echo "Successfully installed $plugin (release version)."
    2344        # ==> mv skin_release.xml skin.xml"
    24         mv $plugindir/skin_release.xml $plugindir/skin.xml
     45        mv $plugin_dir/skin_release.xml $plugin_dir/skin.xml
    2546fi
    2647
Note: See TracChangeset for help on using the changeset viewer.