|
Last change
on this file since 23248 was 23248, checked in by tobayer, 13 years ago |
|
[titan] tobayer01 swapskin: change echo with escape to printf
|
|
File size:
634 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
|
|---|
| 14 |
|
|---|
| 15 | echo_success() { # function to print the OK status
|
|---|
| 16 | printf "%-${RES_COL}s%s\n" "$1" "[ OK ]"
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | echo_failure() { # function to print the FAILED status
|
|---|
| 20 | printf "%-${RES_COL}s%s\n" "$1" "[FAILED]"
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 | ### MAIN ###
|
|---|
| 26 |
|
|---|
| 27 | sync
|
|---|
| 28 | SPACE=`getfreespace $plugin_target`
|
|---|
| 29 | FREE=`expr $SPACE - 100`
|
|---|
| 30 | echo "Old free space: $FREE kB"
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | msg="Removing $plugin..."
|
|---|
| 34 | echo_success "$msg"
|
|---|
| 35 |
|
|---|
| 36 | exit 0
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.