Skip to content

Commit 275061f

Browse files
committed
Add CIFS mounting to the startup script
1 parent 84c1661 commit 275061f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

startup/agx_startup.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,6 +749,16 @@ def hdparm() -> None:
749749
subprocess.run(["hdparm", param, str(value), drive_path], check=True)
750750

751751

752+
def mount_cifs(hostname: str = "192.168.20.20", mount_dir: str = "/mnt/agx-file"):
753+
process = subprocess.run(["ping", "-c", "1", hostname])
754+
if process.returncode:
755+
print(f"The CIFS server {hostname} was not found. Skipping mounting.")
756+
return
757+
subfolders = [f.path for f in os.scandir(mount_dir) if f.is_dir()]
758+
for folder in subfolders:
759+
print(f"Mounting {folder}")
760+
subprocess.run(["mount", folder])
761+
752762
def device_power_control(device: str) -> bool:
753763
if not os.path.exists(device):
754764
print("Device", device, "not found")
@@ -784,3 +794,4 @@ def power_control(
784794
custom_writes()
785795
custom_commands()
786796
fix_boinc()
797+
mount_cifs()

0 commit comments

Comments
 (0)