From: Calin Crisan Date: Wed, 25 Jun 2014 18:25:19 +0000 (+0300) Subject: smb mount point root is now configurable X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=b01a4ea0749d329ad9726b8d6f0d2dc52e5db945;p=motioneye-debian smb mount point root is now configurable --- diff --git a/AUTHORS b/AUTHORS index e50709c..be860ef 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1 +1 @@ -motionEye was written by Calin Crisan +Calin Crisan diff --git a/settings_default.py b/settings_default.py index d90f6bb..ba108a6 100644 --- a/settings_default.py +++ b/settings_default.py @@ -35,6 +35,9 @@ WPA_SUPPLICANT_CONF = None # enable SMB shares (requires root) SMB_SHARES = False +# the directory where the SMB mounts will be created +SMB_MOUNT_ROOT = '/media' + # interval in seconds at which motionEye checks the SMB mounts MOUNT_CHECK_INTERVAL = 300 diff --git a/src/smbctl.py b/src/smbctl.py index 061824f..86ef650 100644 --- a/src/smbctl.py +++ b/src/smbctl.py @@ -41,16 +41,17 @@ def make_mount_point(server, share, username): share = re.sub('[^a-zA-Z0-9]', '_', share).lower() if username: - mount_point = '/media/motioneye_%s_%s_%s' % (server, share, username) + mount_point = os.path.join(settings.SMB_MOUNT_ROOT, 'motioneye_%s_%s_%s' % (server, share, username)) else: - mount_point = '/media/motioneye_%s_%s' % (server, share) + mount_point = os.path.join(settings.SMB_MOUNT_ROOT, 'motioneye_%s_%s' % (server, share)) return mount_point def _is_motioneye_mount(mount_point): - return bool(re.match('^/media/motioneye_\w+$', mount_point)) + mount_point_root = os.path.join(settings.SMB_MOUNT_ROOT, 'motioneye_') + return bool(re.match('^' + mount_point_root + '\w+$', mount_point)) def list_mounts():