Add linies to smb.conf

    • OMV 2.x
    • Add linies to smb.conf

      Hey there,

      i've got a question about adding a line automated to smb.conf.
      When i make changes over omv to smb shares, a new smb.conf is written out.

      Where is the process/template that i can edit, to add a simple line in smb.conf automated?
      I need to add an include statement at the end of the document. (i don't want to edit file manually after every change)
      Is this possible?

      And, if we r already at this point, is it possible, if i add a new user over omv to create a file in a specified directory - like /etc/smb/puc/new_user.conf

      So, what i want to do is, hide folders from certain users. The only way to do this over per-user-configuration.
      So, in smb.conf i set browseable = no, then in user.conf i set [share] browseable = yes. This seem to work.
      I don't think there is any way to write out all config files automatically (smb.conf and all user.confs), so that only valid users get browseable = yes.



      So, any solutions are welcome. Thanks for your help :)
      Christoph

      Edit: Maybe its also possible to run a shell-script after editing. But i have to call this this... Is there any way to call this script aber smb.conf writeout?
      So, i would like to try to program a shell-script after saving smb.conf.
      1) read-out smb.conf
      2) delete per-user-configuration
      3) read out shares
      4) loop from first to last share. Do in every share:
      check if browseable = no. if no, then:
      - read valid users
      - for every valid user, create {valid_user}.conf (where valid_user is the name of the user, so every user gets his own file) . add line [share_name], add line browseable = yes
      - go to next share
      - ignore [homes]
      5) done

      The post was edited 3 times, last by peacemaker ().

    • There are no templates, is more like a php/bash code mix. Those scripts are here

      /usr/share/openmediavault/mkconf/samba.d/

      If you want to change some default samba values look at env variables.

      wiki.openmediavault.org/index.…Environment_Variables/all

      peacemaker wrote:

      And, if we r already at this point, is it possible, if i add a new user over omv to create a file in a specified directory - like /etc/smb/puc/new_user.conf


      That I think need some omv code modification to the user generation script.

      /usr/share/openmediavault/engined/rpc/usermgmt.inc

      Be aware that any patches/mods will get overwritten by omv upgrades.

      Why you take a look if samba can load include with wildacard in global?

      include = /etc/*-samba.conf
      New wiki
      chat support at #openmediavault@freenode IRC | Spanish & English | GMT+10
      telegram.me/openmediavault broadcast channel
      openmediavault discord server