From 46a1ddf7612b9d00eb6c681038d2a431253617f4 Mon Sep 17 00:00:00 2001
From: Marius Tolzmann <tolzmann@molgen.mpg.de>
Date: Tue, 3 Jan 2012 11:32:14 +0100
Subject: [PATCH] check destinationdir..

---
 mxstartup2mxvipcfg | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/mxstartup2mxvipcfg b/mxstartup2mxvipcfg
index f5497f6..6144b1a 100755
--- a/mxstartup2mxvipcfg
+++ b/mxstartup2mxvipcfg
@@ -23,6 +23,11 @@ while(!($packed_ip=gethostbyname($fullhostname))) {
 
 my $hostip = inet_ntoa($packed_ip);
 
+unless(-d $rundir and -w $rundir) {
+   print STDERR "can't write to directory $rundir\n";
+   exit 1;
+}
+
 @lines = read_file($configfile);
 
 my ($host, $user, $script, $ip);