setting a detected masterdir is prolly a bad idea
set the masterdir
removed redundant checks
removed redundant check
bugfix ... undefined var reason
copy the config file to $masterdir/client.conf
clients use client.conf
line too long
use newer stat syntax
use the with statement
use the with statement