aboutsummaryrefslogtreecommitdiffstats
path: root/script/load-exim-logs
diff options
context:
space:
mode:
authorRobin Houston <robin.houston@gmail.com>2012-06-03 14:04:58 +0100
committerRobin Houston <robin.houston@gmail.com>2012-06-03 14:04:58 +0100
commitb357d29826a67ad527c63d823290226ae2d0c871 (patch)
tree7b7f3fb020b9066300fa61da9797591cf8372f01 /script/load-exim-logs
parenta4b739fde6a9da0a72c6171dad020579604b6757 (diff)
Make the scripts bundler-aware
Diffstat (limited to 'script/load-exim-logs')
-rwxr-xr-xscript/load-exim-logs13
1 files changed, 6 insertions, 7 deletions
diff --git a/script/load-exim-logs b/script/load-exim-logs
index 7e7f37a35..5ca0c66f8 100755
--- a/script/load-exim-logs
+++ b/script/load-exim-logs
@@ -1,21 +1,20 @@
#!/bin/bash
-LOC=`dirname $0`
+LOC=`dirname "$0"`
# Specific file if specified
if [ x$1 != x ]
then
- "$LOC/runner" 'EximLog.load_file("'$1'")'
+ f=`abspath "$1"`
+ cd "$LOC"
+ bundle exec ./runner 'EximLog.load_file("'$f'")'
exit
fi
# Load in last three days worth of logs (if they've been modified)
+cd "$LOC"
LATEST=$( ls /var/log/exim4/exim-mainlog-* 2>/dev/null | sort | tail -3 )
for X in $LATEST
do
- # echo "doing $X"
- "$LOC/runner" 'EximLog.load_file("'$X'")'
+ bundle exec ./runner 'EximLog.load_file("'$X'")'
done
-
-
-