diff options
Diffstat (limited to 'lib/sunhpc/commands/sync/users/plugin_00_fixmaster.py')
-rw-r--r-- | lib/sunhpc/commands/sync/users/plugin_00_fixmaster.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/sunhpc/commands/sync/users/plugin_00_fixmaster.py b/lib/sunhpc/commands/sync/users/plugin_00_fixmaster.py new file mode 100644 index 0000000..e8bf082 --- /dev/null +++ b/lib/sunhpc/commands/sync/users/plugin_00_fixmaster.py @@ -0,0 +1,19 @@ +#coding:utf-8 + +import os +import sunhpc +class Plugin(sunhpc.commands.Plugin): + """Relocates home directories to location on file server and fixes autofs.share""" + + def run(self, args): + """修复auto.share文件""" + + # 默认auto.master数据 + share_mount = '/share /etc/auto.share --timeout=1200' + homes_mount = '/home /etc/auto.home --timeout=1200' + auto_master = '/etc/auto.master' + + if self.cmd.matchText(auto_master, share_mount): + with open(auto_master, 'w') as f: + f.write('%s\n' % share_mount) + f.write('%s\n' % homes_mount) |