|
Last change
on this file since 23247 was 23247, checked in by tobayer, 13 years ago |
|
[titan] tobayer01 swapskin: optimize control files
|
|
File size:
747 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 |
|
|---|
| 3 | plugin_short="tobayer01"
|
|---|
| 4 | plugin_type="swapskin"
|
|---|
| 5 | plugin_target="/var/swap/titanskins"
|
|---|
| 6 |
|
|---|
| 7 | plugin_dir="$plugin_target/$plugin_short"
|
|---|
| 8 | plugin="$plugin_short $plugin_type"
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 | ### FUNCTIONS ###
|
|---|
| 12 |
|
|---|
| 13 | RES_COL=60 # column number to place the status message
|
|---|
| 14 | MOVE_TO_COL="echo -en \\033[${RES_COL}G" # command to move to the configured column number
|
|---|
| 15 |
|
|---|
| 16 | echo_success() { # function to print the SUCCESS status
|
|---|
| 17 | $MOVE_TO_COL; echo -n "[ OK ]"; echo
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | echo_failure() {
|
|---|
| 21 | $MOVE_TO_COL; echo -n "[FAILED]"; echo # function to print the FAILED status message
|
|---|
| 22 | }
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | ### MAIN ###
|
|---|
| 27 |
|
|---|
| 28 | rm -rf $plugin_dir
|
|---|
| 29 |
|
|---|
| 30 | sync
|
|---|
| 31 | SPACE=`getfreespace $plugin_target`
|
|---|
| 32 | FREE=`expr $SPACE - 100`
|
|---|
| 33 | echo
|
|---|
| 34 | echo "New free space: $FREE kB"
|
|---|
| 35 |
|
|---|
| 36 | echo "Successfully removed $plugin."
|
|---|
| 37 |
|
|---|
| 38 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.