J'essaye de faire un script qui monte automatiquement un apn dès qu'il est branché sur /dev/sda mais j'ai l'impression qu'il ralentit considérablement le système. Comment le rendre moins gourmand en ressource?
Fichier autoapn:
#!/bin/sh
ALREADY=0
while /bin/true
do
dd if=/dev/sda1 of=/dev/null count=1 &>/dev/null
ERR=$?
if [ $ERR = 0 ]
then
if [ $ALREADY = 0 ]
then
xterm -e apn_trouve
ALREADY=1
fi
elif [ $ERR = 1 ]
then
if [ $ALREADY = 1 ]
then
xterm -e apn_debranche
(…)
Forum Programmation.shell Script d'automontage d'APN : très lent
25
sept.
2004