Skip to content

Commit

Permalink
Commented current code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tarleb committed Nov 29, 2011
1 parent 0e210bc commit 0f2cd69
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions ffmon.sh
Expand Up @@ -2,6 +2,7 @@

# batctl o|cut -c1-17,19-27|tail -n +3

# Draw all the things!
redraw() {
draw_header
draw_nodelist
Expand All @@ -19,6 +20,7 @@ draw_nodelist() {
batctl o|cut -c1-17,19-27|tail -n +3
}

# Correct for changed lines/column values.
resize() {
COLUMNS=$(tput cols)
LINES=$(tput lines)
Expand All @@ -29,20 +31,34 @@ cleanup() {
rm -rf $MACDIR
}

COLUMNS=0
LINES=0

MACDIR=$(mktemp -d)

trap cleanup EXIT
### PROGRAM STARTS HERE
### ===================

resize
## Initialize
## ----------
COLUMNS=0
LINES=0

trap resize WINCH
# Create a temporary directory to keep track of all the connection data.
MACDIR=$(mktemp -d ffmon.XXXXXXXXXX)

resize
clear

## Program Loop
## ------------
while true; do
redraw
sleep 1
done



### TRAPS
### =====
trap cleanup EXIT

# Trap terminal window resize operations
trap resize WINCH

0 comments on commit 0f2cd69

Please sign in to comment.