-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include Juan's script #23
base: master
Are you sure you want to change the base?
Conversation
Hi! Change the term "./domainconfmenu.sh" to the final name turnkey-dc-conf You would have to add the code to work correctly #create directory #create separate files and link them in smb.conf ##The latter is necessary for the script to work |
It probably won't fix it, but perhaps it's worth trying with I used slightly different code to what you suggested but it should do the same thing. The only thing that I'm not 100% sure about is the |
- Double quote variables. - Reindent the code (first level indent only one space; normal 4 space indents after that). - implement some bashisms (e.g. double braket tests) - removed some superfluous spaces and blank lines
I've double quoted the I also ended up making quite a few other changes, although they should all be cosmetic (shouldn't affect functionality). |
I am writing a code to solve this, it can be added to the menu or executed independently, we will see Hi! mkdir -p /home/{users,shares} After investigating the operation of bash, when set -e in #!/Bin/bash, it exits the execution of the command when the return is 0, since the grep command when it does not find a match, its return is 1, if we apply the option -e in #!/bin/bash, it will always terminate the execution of the command when grep is used even if it works correctly, I don't know how to solve this. |
Hi @j20003 - sorry for slow response. I'll have a closer look at this next week. I'm a bit bogged down with v17.0 development at the moment. I am currently blocking others from being able to work on upgrading appliances for the upcoming v17.0 release so I need to prioritise that. I'd really like to get this working and included in the next Domain Controller though, so I'll try to circle back to this ASAP. |
Perfect, verified that removing the -e from |
Ah ok. Setting 'e' forces the script to exit if/when it hits an error (non zero exit code from one of the commands that is being run). So one of the commands must be failing. It's good practice to set 'e' as otherwise scripts can have unexpected results (i.e. actually they aren't working properly - even when they appear to work). To troubleshoot what is actually failing, try setting 'x' too. I.e.:
That will make the output really verbose and because we're using dialog, it will make things quite ugly. But on the plus side, you will see exactly what the error is/was. |
Also:
Ah ok. Sorry I misunderstood. So those lines shouldn't actually be part of the script! We should just make those adjustments at initial build time (in the conf.d script). |
That's the idea, get it ready for the turnkey-dc-conf script to work or it could be entered as the first option of turnkey-dc-conf Something like this code: `#!/bin/bash -x
var1=$(grep "include = /etc/samba/shares.conf" /etc/samba/smb.conf) if [[ $var1 == $var2 ]];then
fi
#Making directorys, separate files and link them in smb.conf grep "include = /etc/samba/shares.conf" /etc/samba/smb.conf
exit` |
Tanks Tomorrow I try it |
I propose that we add this script by Juan to the TurnKey Domain Controller appliance.
Note that I've named the script
turnkey-dc-conf
. As per general convention, TurnKey provided end user helper script names generally start withturnkey-
(ortkl
). The rationale for that is that it makes it easier for users to know that it's a script we include; plus easy to find via cli tab complete.Also, this needs though testing to double check that it all works as it should (I've only visually reviewed the code).
Closes turnkeylinux/tracker#1655