|
|
|
Use the ssh man page as a starting point for sshd_config
So, first off, either the call to popen should have "/usr/bin/" prepended to each of the command names (man, col, expand, sed), or whatever python magic necessary should be done to prepend /usr/bin to the path to ensure that the script actually runs the expected programs (I have a front-end to man in my ~/bin directory which got run instead of /usr/bin/man).
Second (after working around the above problem)... the output doesn't make a lot of sense to me. I end up with parts of the man page copied into the output file (second command line arg) as comments, but the interesting part (all the tweaks I've made to sshd_config) all go to stdout (apparently from the "print line" at the end of the "edit man page to insert option values" section). Surely you wanted to interpolate those into the output file...? For what it's worth, this is running on a Tiger system.
Use the ssh man page as a starting point for sshd_config
I had the same problem. Then I realized that for some reason all of the \'s were missing.
Here's the diff FWIW: cva:~ $ diff sshd_config_py.txt sshd_config.py 50c50 < pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)s{2,}(S.*)$' --- > pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)\s{2,}(\S.*)$' 73c73 < pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)s+(.*)$' --- > pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)\s+(.*)$' 82c82 < new[index] = '# %s %sn' % (option, value) --- > new[index] = '# %s %s\n' % (option, value) 84c84 < new[index] += 'n%s %snn' % (option, value) --- > new[index] += '\n%s %s\n\n' % (option, value)
Use the ssh man page as a starting point for sshd_config
oops, looks like I missed a couple. Here's the real diff ;)
cva:~ $ diff sshd_config_py.txt sshd_config.py 50c50 < pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)s{2,}(S.*)$' --- > pat = r'^(# [A-Z]+[a-z][a-zA-Z]*)\s{2,}(\S.*)$' 57,58c57,58 < new.append("%sn" % option) < new.append("# %sn" % text) --- > new.append("%s\n" % option) > new.append("# %s\n" % text) 73c73 < pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)s+(.*)$' --- > pat = r'^(#)?([A-Z][a-z][a-zA-Z]+)\s+(.*)$' 82c82 < new[index] = '# %s %sn' % (option, value) --- > new[index] = '# %s %s\n' % (option, value) 84c84 < new[index] += 'n%s %snn' % (option, value) --- > new[index] += '\n%s %s\n\n' % (option, value) |
SearchFrom our Sponsor...What's New:Hints4 new Hints in the last 24 hoursComments last 2 days
Links last 2 weeksNo recent new linksWhat's New in the Forums?
The Editor's Corner...Here are some of my (robg) other projects...
Hints by TopicNews from Macworld
The macosxhints PollWhat version of OS X are you running as your main OS?
Other polls | 11,317 votes | 42 comments
|
|
Copyright © 2009 Mac Publishing LLC (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Powered by Geeklog Created this page in 0.15 seconds |
|