Skip to content

Commit

Permalink
smb mount point root is now configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrisan committed Jun 25, 2014
1 parent 1039ab4 commit b01a4ea
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion AUTHORS
@@ -1 +1 @@
motionEye was written by Calin Crisan <ccrisan@gmail.com>
Calin Crisan <ccrisan@gmail.com>
3 changes: 3 additions & 0 deletions settings_default.py
Expand Up @@ -35,6 +35,9 @@
# 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

Expand Down
7 changes: 4 additions & 3 deletions src/smbctl.py
Expand Up @@ -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():
Expand Down

0 comments on commit b01a4ea

Please sign in to comment.