Hallo,
wie sagt man den in der bash-Sprache:
Wenn das Device /dev/hda1 gemountet ist tue dies?
Gruß Nixdorf
abfrage
-
Roger Wilco
- Posts: 5923
- Joined: 2004-05-23 12:53
Re: abfrage
Code: Select all
grep '^/dev/hda1 ' /proc/mounts>/dev/null && echo 'Partition ist eingehängt'
Last edited by Roger Wilco on 2010-05-21 17:01, edited 1 time in total.
Re: abfrage
Automatisiert dann per udev...
PayPal.Me/JoeUser ● FreeBSD Remote Installation
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Wings for Life ● Wings for Life World Run
„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.
Re: abfrage
Danke, mit dem Rüstzeug sollte ich es schaffen...
Gruß NIxdorf
Gruß NIxdorf
Re: abfrage
Das ist aber nicht sehr portabel... /proc gibt es nur unter Linux. Wenn das Skript auf einem anderen *NIX laufen soll, ist es sicherer, die Ausgabe von mount an grep zu pipen (der mount-Befehl ist AFAIK im POSIX-Standard verankert).Roger Wilco wrote:Code: Select all
grep '^/dev/hda1 ' /proc/mounts>/dev/null && echo 'Partition ist eingehängt'
“Some humans would do anything to see if it was possible to do it. If you put a large switch in some cave somewhere, with a sign on it saying 'End-of-the-World Switch. PLEASE DO NOT TOUCH', the paint wouldn't even have time to dry.” — Terry Pratchett, Thief of Time

