1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

SMB custom config script not applying changes

Discussion in 'Asuswrt-Merlin' started by Massimo93, Apr 14, 2019.

  1. Massimo93

    Massimo93 Occasional Visitor

    Joined:
    Mar 16, 2019
    Messages:
    25
    Hi, i've created a custom script (/jffs/scripts/smb.postconf) for adding access based share enum = true to smb config but the changes just won't apply.
    I've checked the log and the script seem to run without errors and regarding the smb daemon it disable before and start after the script execution

    here is the script:
    Code:
    #!/bin/sh
    CONFIG=$1
    source /usr/sbin/helper.sh
    pc_insert "smb passwd file = /etc/samba/smbpasswd" "access based share enum = true" $CONFIG
     
    Last edited: Apr 16, 2019
  2. dave14305

    dave14305 Very Senior Member

    Joined:
    May 19, 2018
    Messages:
    872
    Please move it to /jffs/scripts.
     
  3. Massimo93

    Massimo93 Occasional Visitor

    Joined:
    Mar 16, 2019
    Messages:
    25
    Sorry. It was in /jffs/scripts not /jffs/configs. Il edit it.
     
  4. dave14305

    dave14305 Very Senior Member

    Joined:
    May 19, 2018
    Messages:
    872
    Ok then make sure to run
    Code:
    chmod u+x /jffs/scripts/smb.postconf
    service restart_samba
     
    Massimo93 likes this.
  5. Massimo93

    Massimo93 Occasional Visitor

    Joined:
    Mar 16, 2019
    Messages:
    25
    That worked, thanks.
    I think that a check for permission should be added. Ill open a issue on github.
     
  6. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    8,814
    Location:
    UK
    Why? It's already explained in the wiki.
     
  7. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    30,596
    Location:
    Canada
    File permissions are an inherent part of Linux. It's up to users to properly set them, just like it's up to them to set a valid shebang in their script.
     
    thelonelycoder and joe scian like this.
  8. Massimo93

    Massimo93 Occasional Visitor

    Joined:
    Mar 16, 2019
    Messages:
    25
    Yes, true but still humans prone to errors, without an error log could be hard to understand where it lies the problem.
    I don't know how asuswrt log system works but i was just wondering if it could be easily implemented.

    Sry didn't read that part, i just went straight here
     
  9. ColinTaylor

    ColinTaylor Part of the Furniture

    Joined:
    Mar 31, 2014
    Messages:
    8,814
    Location:
    UK
    Good point. I'll make a note in the wiki.
     
    thelonelycoder and Massimo93 like this.
  10. john9527

    john9527 Part of the Furniture

    Joined:
    Mar 28, 2014
    Messages:
    6,096
    Location:
    United States
    It was only a couple of lines of code (gotta love the stackoverflow site :) ), so I added the script executable check to my fork.
    Code:
    Apr 16 10:54:13 Samba_Server: smb daemon is stopped
    Apr 16 10:54:13 kernel: gro disabled
    Apr 16 10:54:13 kernel: gro enabled with interval 2
    Apr 16 10:54:13 custom_config: Appending content of /jffs/configs/smb.conf.add.
    Apr 16 10:54:13 custom_script: Found smb.postconf, but script is not marked executable!
    Apr 16 10:54:14 Samba_Server: daemon is started
     
  11. RMerlin

    RMerlin Super Moderator

    Joined:
    Apr 14, 2012
    Messages:
    30,596
    Location:
    Canada
    Having a check is not a bad idea. I thought he meant making the script executable automatically.

    Sent from my ELE-L04 using Tapatalk
     
  12. Massimo93

    Massimo93 Occasional Visitor

    Joined:
    Mar 16, 2019
    Messages:
    25
    Great job, that's what i was talking about.