diff options
author | xiubuzhe <xiubuzhe@sina.com> | 2023-10-08 20:59:00 +0800 |
---|---|---|
committer | xiubuzhe <xiubuzhe@sina.com> | 2023-10-08 20:59:00 +0800 |
commit | 1dac2263372df2b85db5d029a45721fa158a5c9d (patch) | |
tree | 0365f9c57df04178a726d7584ca6a6b955a7ce6a /lib/sunhpc/commands/sync/users/plugin_00_fixmaster.py | |
parent | b494be364bb39e1de128ada7dc576a729d99907e (diff) | |
download | sunhpc-1dac2263372df2b85db5d029a45721fa158a5c9d.tar.gz sunhpc-1dac2263372df2b85db5d029a45721fa158a5c9d.tar.bz2 sunhpc-1dac2263372df2b85db5d029a45721fa158a5c9d.zip |
first add files
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) |