added fstab setup script
This commit is contained in:
parent
2730e8344e
commit
2f62c1488f
1 changed files with 22 additions and 0 deletions
22
src/setup/system/fstab.py
Normal file
22
src/setup/system/fstab.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
from os import system
|
||||
|
||||
name = "fstab"
|
||||
|
||||
|
||||
def setup():
|
||||
"""adds /media/pomp/data drive to fstab"""
|
||||
|
||||
fstab_path = "/etc/fstab"
|
||||
|
||||
# check if /media/pomp/data exists already
|
||||
with open(fstab_path, "rt") as f:
|
||||
if "/media/pomp/data" in f.read():
|
||||
return
|
||||
|
||||
line_to_write = (
|
||||
"UUID=1cea13a5-ea19-4023-99dd-4bfd062a288c /media/pomp/data ext4 defaults 0 2"
|
||||
)
|
||||
|
||||
# append a line to the end and ignore output
|
||||
# not using python's file interface because I don't wanna deal with permission stuff
|
||||
system(f'echo "{line_to_write}" | sudo tee -a {fstab_path} >/dev/null')
|
Loading…
Add table
Add a link
Reference in a new issue