diff --git a/.gitignore b/.gitignore index 76ecae0a..8bf4d79a 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ pupy/modules/lib/*.py[cod] pupy/modules/lib/**/*.py[cod] pupy/network/**/*.pyc pupy/scriptlets/**/*.pyc +pupy/pupy.conf # do not ignore package & templates files !pupy/packages/ diff --git a/pupy/pupy.conf b/pupy/pupy.conf.default similarity index 100% rename from pupy/pupy.conf rename to pupy/pupy.conf.default diff --git a/pupy/pupylib/PupyServer.py b/pupy/pupylib/PupyServer.py index becb0071..1ee08b2b 100644 --- a/pupy/pupylib/PupyServer.py +++ b/pupy/pupylib/PupyServer.py @@ -29,6 +29,8 @@ from pupylib.utils.rpyc_utils import obtain from .PupyTriggers import on_connect from network.lib.utils import parse_transports_args from network.lib.base_launcher import LauncherError +from os import path +from shutil import copyfile import network.conf import rpyc import shlex @@ -53,6 +55,8 @@ class PupyServer(threading.Thread): self.clients_lock=threading.Lock() self.current_id=1 self.config = configparser.ConfigParser() + if not path.exists('pupy.conf'): + copyfile('pupy.conf.default', 'pupy.conf') self.config.read("pupy.conf") if port is None: self.port=self.config.getint("pupyd", "port")