What's new

SMB custom config script not applying changes

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Massimo93

Occasional Visitor
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:
Please move it to /jffs/scripts.
 
Ok then make sure to run
Code:
chmod u+x /jffs/scripts/smb.postconf
service restart_samba
 
I think that a check for permission should be added. Ill open a issue on github.

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.
 
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.

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.

Why? It's already explained in the wiki.
Sry didn't read that part, i just went straight here
 
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
 
Having a check is not a bad idea. I thought he meant making the script executable automatically.

Sent from my ELE-L04 using Tapatalk
 
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

Great job, that's what i was talking about.
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top