commit ded1f5601d2ece295d67831ee3a9ee6e2d60d4f1 parent 2f339068e35ab015c29f76f6cc46efa9af8eeae4 Author: Kill Your TV <killyourtv@i2pmail.org> Date: Wed, 8 Oct 2014 19:57:53 +0000 print state Diffstat:
M | rat-list | | | 10 | ++++++++-- |
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/rat-list b/rat-list @@ -25,8 +25,14 @@ print_output() { for ID in $IDS; do NAME=$(cat $ID/name | tr -d '\n') STATUS=$(cat $ID/status | cut -c-30 |tr -d '\n') - ONLINE=$(online $(cat $ID/online)) - printf "%-12s\t%-10s\t%-30s\t\t%-30s\n" $(echo $ID | cut -c-12) "$ONLINE" "$NAME" "$STATUS" + STATE=$(cat $ID/state | sed 's/.*/\u&/') + ONLINE=$(cat $ID/online) + if [ $STATE != 'None' ] && [ "$ONLINE" -ne 0 ]; then + ONLINE=$STATE + else + ONLINE=$(online $ONLINE) + fi + printf "%-12s\t%-8s\t%-30s\t\t%-30s\n" $(echo $ID | cut -c-12) "$ONLINE" "$NAME" "$STATUS" done }