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/postrm

    r23203 r23247  
    11#!/bin/sh
    22
    3 plugin="tobayer01 swapskin"
    4 plugindir="/var/swap/titanskins/tobayer01"
    5 link=`readlink /var/swap`
     3plugin_short="tobayer01"
     4plugin_type="swapskin"
     5plugin_target="/var/swap/titanskins"
    66
    7 rm -rf $plugindir
     7plugin_dir="$plugin_target/$plugin_short"
     8plugin="$plugin_short $plugin_type"
    89
    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
     10
     11### FUNCTIONS ###
     12
     13RES_COL=60                                                                      # column number to place the status message
     14MOVE_TO_COL="echo -en \\033[${RES_COL}G"        # command to move to the configured column number
     15
     16echo_success() {                                                        # function to print the SUCCESS status
     17        $MOVE_TO_COL; echo -n "[  OK  ]"; echo
     18}
     19
     20echo_failure() {
     21        $MOVE_TO_COL; echo -n "[FAILED]"; echo  # function to print the FAILED status message
     22}
     23
     24
     25
     26### MAIN ###
     27
     28rm -rf $plugin_dir
     29
     30sync
     31SPACE=`getfreespace $plugin_target`
     32FREE=`expr $SPACE - 100`
     33echo
     34echo "New free space: $FREE kB"
    1635
    1736echo "Successfully removed $plugin."
Note: See TracChangeset for help on using the changeset viewer.