|
Last change
on this file since 23247 was 23247, checked in by tobayer, 13 years ago |
|
[titan] tobayer01 swapskin: optimize control files
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | releaseversion=22775
|
|---|
| 4 | plugin_short="tobayer01"
|
|---|
| 5 | plugin_type="swapskin"
|
|---|
| 6 | plugin_target="/var/swap/titanskins"
|
|---|
| 7 |
|
|---|
| 8 | plugin_dir="$plugin_target/$plugin_short"
|
|---|
| 9 | plugin="$plugin_short $plugin_type"
|
|---|
| 10 |
|
|---|
| 11 | imageversion=`cat /etc/version | cut -d "_" -f2 | sed 's/M//'`;
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | ### FUNCTIONS ###
|
|---|
| 15 |
|
|---|
| 16 | RES_COL=60 # column number to place the status message
|
|---|
| 17 | MOVE_TO_COL="echo -en \\033[${RES_COL}G" # command to move to the configured column number
|
|---|
| 18 |
|
|---|
| 19 | echo_success() { # function to print the SUCCESS status
|
|---|
| 20 | $MOVE_TO_COL; echo -n "[ OK ]"; echo
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | echo_failure() {
|
|---|
| 24 | $MOVE_TO_COL; echo -n "[FAILED]"; echo # function to print the FAILED status message
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 | ### MAIN ###
|
|---|
| 30 |
|
|---|
| 31 | sync
|
|---|
| 32 | SPACE=`getfreespace $plugin_target`
|
|---|
| 33 | FREE=`expr $SPACE - 100`
|
|---|
| 34 | echo
|
|---|
| 35 | echo "New free space: $FREE kB"
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 | if [ "$imageversion" -gt "$releaseversion" ]; then
|
|---|
| 39 | echo "Successfully installed $plugin (non-release version)."
|
|---|
| 40 | # ==> rm skin_release.xml
|
|---|
| 41 | rm $plugin_dir/skin_release.xml
|
|---|
| 42 | else
|
|---|
| 43 | echo "Successfully installed $plugin (release version)."
|
|---|
| 44 | # ==> mv skin_release.xml skin.xml"
|
|---|
| 45 | mv $plugin_dir/skin_release.xml $plugin_dir/skin.xml
|
|---|
| 46 | fi
|
|---|
| 47 |
|
|---|
| 48 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.