diff options
author | Cecil <knoppmyth@gmail.com> | 2012-01-14 20:46:12 (GMT) |
---|---|---|
committer | Cecil <knoppmyth@gmail.com> | 2012-01-14 20:46:12 (GMT) |
commit | c321283760591e3c6e5d9ed415e9c422fee83d9e (patch) | |
tree | 4e482fdf514f477c7ac23e0da81ec82a51a53b39 /abs/core/LinHES-system/fix_myth_mount.py | |
parent | e9948fef7a06dbb6b0c53e50df10c0a0dc2d941b (diff) | |
parent | d5525acd5a4054460b98930b46d9de5690c1fd36 (diff) | |
download | linhes_pkgbuild-c321283760591e3c6e5d9ed415e9c422fee83d9e.zip linhes_pkgbuild-c321283760591e3c6e5d9ed415e9c422fee83d9e.tar.gz linhes_pkgbuild-c321283760591e3c6e5d9ed415e9c422fee83d9e.tar.bz2 |
Merge branch 'testing' of ssh://cesman@linhes.org/mount/repository/linhes_pkgbuild into testing
Diffstat (limited to 'abs/core/LinHES-system/fix_myth_mount.py')
-rw-r--r-- | abs/core/LinHES-system/fix_myth_mount.py | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/abs/core/LinHES-system/fix_myth_mount.py b/abs/core/LinHES-system/fix_myth_mount.py new file mode 100644 index 0000000..9f3cc54 --- /dev/null +++ b/abs/core/LinHES-system/fix_myth_mount.py @@ -0,0 +1,51 @@ +#!/usr/bin/python2 +import os +import sys +cmd="cp -f /etc/fstab /etc/fstab.backup.pre_acl" +os.system(cmd) +f = open('/etc/fstab', 'r') +fstab=f.readlines() +f.close() +mp='/data/mnt/d1' + +def check_fstab_mount(): + #first check if media/d1 is in list, if not add it. + newfstab=[] + mnt_in_fstab=False + for line in fstab: + split_line=line.split() + try: + if split_line[1] == mp : + print "found mountpoint if fstab" + mnt_in_fstab = True + break + except: pass + return mnt_in_fstab + +def add_mnt_to_fstab(): + newfstab=[] + for line in fstab: + newfstab.append(line) + split_line=line.split() + try: + if split_line[1] == "/myth": + split_line[1] = mp + new_line='\t'.join(split_line)+"\n" + newfstab.append(new_line) + except: + pass + + return newfstab + + + +if check_fstab_mount() == False: + print "I need to add it" + newfstab=add_mnt_to_fstab() + f = open('/tmp/fstab', 'w') + for i in newfstab: + f.write(i) + #f.write("\n") + f.close() + + |