import subprocess
import sys
-
+import traceback
DISKS = ["Bêta", "Epsilon", "Delta", "Zêta"]
print out
+def mount_by_name(name):
+ """Rajoute les paths habituels"""
+ mount("/dev/disk/by-label/%s" % name, "/media/%s" % name)
+
if __name__ == "__main__":
param = sys.argv[1]
if param == "-l":
for i in DISKS:
print i
sys.exit(0)
- mount("/dev/disk/by-label/%s" % param, "/media/%s" % param)
+ elif param == "all":
+ print "Mounting all the disk : %s" % ", ".join(DISKS)
+ mountlist = DISKS
+ else:
+ mountlist = [param]
+ for disk in mountlist:
+ try:
+ mount_by_name(disk)
+ except RuntimeError:
+ print traceback.format_exc()
--- /dev/null
+#!/bin/bash
+
+# Pour monter tous les disques externes d'un coup
+
+
+# On vire le gardbage créé par les automount anarchiques
+umount /media/*_
+
+/home/vincent/scripts/mountdisk.py all