Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
toshiba_satellite_u500-17d [Le 26/03/2016, 17:10] L'Africain Nettoyage de la page |
toshiba_satellite_u500-17d [Le 08/10/2022, 17:06] (Version actuelle) Amiralgaby [Ventilateur] deprecated egrep - trouvé avec wiki-corrector + amélioration du script |
||
---|---|---|---|
Ligne 50: | Ligne 50: | ||
<file bash> | <file bash> | ||
#!/bin/sh | #!/bin/sh | ||
+ | |||
### BEGIN INIT INFO | ### BEGIN INIT INFO | ||
# Provides: mando | # Provides: mando | ||
Ligne 58: | Ligne 58: | ||
# Default-Stop: | # Default-Stop: | ||
# Short-Description: patch toshiba | # Short-Description: patch toshiba | ||
- | # Description: tweak to improve cooling | + | # Description: tweak to improve cooling |
### END INIT INFO | ### END INIT INFO | ||
+ | |||
. /lib/lsb/init-functions | . /lib/lsb/init-functions | ||
+ | |||
[ -f /etc/default/rcS ] && . /etc/default/rcS | [ -f /etc/default/rcS ] && . /etc/default/rcS | ||
PATH=/bin:/usr/bin:/sbin:/usr/sbin | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
+ | |||
COOLING_DEVICES_DIR="/sys/devices/virtual/thermal" | COOLING_DEVICES_DIR="/sys/devices/virtual/thermal" | ||
- | SERVICE_NAME="$(basename $0)" | + | SERVICE_NAME="$(basename "$0")" |
+ | |||
case "$1" in | case "$1" in | ||
start) | start) | ||
log_begin_msg "Preparing cooling device" | log_begin_msg "Preparing cooling device" | ||
+ | |||
for x in $(find $COOLING_DEVICES_DIR | grep cur_state) | for x in $(find $COOLING_DEVICES_DIR | grep cur_state) | ||
do | do | ||
- | device_dir="$(dirname $x)" | + | device_dir="$(dirname "$x")" |
- | num_device="$(echo $device_dir | egrep -o "cooling_device[0-9]+" | egrep -o "[0-9]+")" | + | num_device="$(echo "$device_dir" | grep -Eo '[0-9]+$')" |
- | max_state="$(cat $device_dir/max_state)" | + | max_state="$(cat "$device_dir"/max_state)" |
new_state="0" | new_state="0" | ||
- | if [ $num_device -gt 4 ] | + | if [ "$num_device" -gt 4 ] |
then | then | ||
new_state=$max_state | new_state=$max_state | ||
fi | fi | ||
- | echo -n $new_state > $device_dir/cur_state; | + | printf "%s" "$new_state" > "$device_dir/cur_state" |
done | done | ||
+ | |||
log_end_msg 0 | log_end_msg 0 | ||
;; | ;; | ||
Ligne 99: | Ligne 99: | ||
exit 1 | exit 1 | ||
esac | esac | ||
+ | |||
exit 0 | exit 0 | ||
</file> | </file> | ||
Ligne 137: | Ligne 137: | ||
===== Voir aussi ===== | ===== Voir aussi ===== | ||
- | * (en) [[http://ubuntuforums.org/archive/index.php/t-1473317.html|Le problème de ventilateur]] sur le forum ubuntuforums.org. | + | * (en) [[https://ubuntuforums.org/archive/index.php/t-1473317.html|Le problème de ventilateur]] sur le forum ubuntuforums.org. |
* (fr) [[http://fr.computers.toshiba-europe.com/innovation/download_drivers_bios.jsp|Site fournissant la mise à jour du BIOS]] | * (fr) [[http://fr.computers.toshiba-europe.com/innovation/download_drivers_bios.jsp|Site fournissant la mise à jour du BIOS]] | ||
* (fr) [[:toshiba_satellite_u500-119|Page dédiée au modèle Toshiba u500-119]] | * (fr) [[:toshiba_satellite_u500-119|Page dédiée au modèle Toshiba u500-119]] |