Permalink
Browse files

Important fix to getPlugins () and getDone () to stop buildup of tmp …

…files
  • Loading branch information...
1 parent 23d277b commit 0ca034886a677be04e70b4a9e592bc468419da95 @TnTBass committed Apr 1, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 include/scripts/functions.sh
@@ -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'
@@ -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`
}

0 comments on commit 0ca0348

Please sign in to comment.