Skip to content

Commit

Permalink
Important fix to getPlugins () and getDone () to stop buildup of tmp …
Browse files Browse the repository at this point in the history
…files
  • Loading branch information
TnTBass committed Apr 1, 2012
1 parent 23d277b commit 0ca0348
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions include/scripts/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,10 @@ fi

# Get Plugin Info
getPlugins () {
plugintmp=`mktemp "/tmp/plugins-$abmid.XXXXXX"`
grep "Plugins" $slog |head -1 |awk '{ $1=""; $2=""; $3=""; $4=""; print $0 }' > $plugintmp
if [[ ! -f $plugintmp ]]; then
plugintmp=`mktemp "/tmp/plugins-$abmid.XXXXXX"`
grep "Plugins" $slog |head -1 |awk '{ $1=""; $2=""; $3=""; $4=""; print $0 }' > $plugintmp
fi
plugins=`cat $plugintmp`
if [[ -z $plugins ]]; then
screen -S bukkit-server -p 0 -X eval 'stuff '"plugins"'\015'
Expand All @@ -582,8 +584,10 @@ getPlugins () {

# function to find "Done" time.
getDone () {
donetmp=`mktemp "/tmp/done-$abmid.XXXXXX"`
grep "Done ([0-9]\{1,\}\.[0-9]\{1,\}s)\!" $slog | awk '{print $5}' > $donetmp
if [[ ! -f $donetmp ]]; then
donetmp=`mktemp "/tmp/done-$abmid.XXXXXX"`
grep "Done ([0-9]\{1,\}\.[0-9]\{1,\}s)\!" $slog | awk '{print $5}' > $donetmp
fi
doneTime=`cat $donetmp`
}

Expand Down

0 comments on commit 0ca0348

Please sign in to comment.