Des scripts pour faciliter le reconditionnement de portables - retour accueil
git clone git://bebou.netlib.re/scripts-reco
Log | Files | Refs | README |
rapport (1792B)
1 # Modèle 2 ( 3 printf "Modèle : %s\n" "$(cat /sys/devices/virtual/dmi/id/product_name)" 4 printf "Num série : %s\n" "$(sudo cat /sys/devices/virtual/dmi/id/product_serial)" 5 6 # CPU 7 cat /proc/cpuinfo | grep "^model name" | sort -u | sed 's/^[^:]*:/CPU :/' 8 9 # RAM 10 sudo dmidecode -t memory | awk -F':' ' 11 /Memory Device/ { mem++ } 12 /^ Size:/ && mem>0 { arr[mem,"size"]=$2 } 13 /^ Type:/ && mem>0 { arr[mem,"type"]=$2 } 14 /^ Manufacturer:/ && mem>0 { arr[mem,"manuf"]=$2 } 15 /^ Configured Memory Speed:/ && mem>0 { arr[mem,"speed"]=$2 } 16 END { for(i=1;i<=mem;i++) 17 { printf "RAM : %s, %s, %s, %s\n",arr[i,"size"],arr[i,"type"],arr[i,"speed"],arr[i,"manuf"]} 18 }' 19 20 # GPU 21 sudo dmidecode -t baseboard | awk -F': ' ' 22 /^Onboard Device/ { mem++ } 23 /^ Type:/ && mem>0 { arr[mem,"type"]=$2 } 24 /^ Reference Designation:/ && mem>0 { arr[mem,"name"]=$2 } 25 /^ Status:/ && mem>0 { arr[mem,"status"]=$2 } 26 END { for(i=1;i<=mem;i++) 27 { if(arr[i,"type"]=="Video") { printf "GPU : %s, %s, %s\n",arr[i,"type"],arr[i,"name"],arr[i,"status"]} } 28 }' 29 30 # Batterie 31 32 for batterie in $(find /sys/class/power_supply/ -type l -name 'BAT*');do 33 . "$batterie/uevent" 34 health=$(echo "$POWER_SUPPLY_CHARGE_FULL / $POWER_SUPPLY_CHARGE_FULL_DESIGN * 100" | bc -l | cut -d'.' -f1) 35 <<-. cat 36 Batterie : $(basename $batterie) 37 Batterie : Capacité totale initiale ${POWER_SUPPLY_CHARGE_FULL_DESIGN%???} mAh 38 Batterie : Capacité totale courante ${POWER_SUPPLY_CHARGE_FULL%???} mah, ratio : $health 39 Batterie : Charge courante ${POWER_SUPPLY_CHARGE_NOW%???} mAh, $POWER_SUPPLY_CAPACITY% 40 Batterie : Status $POWER_SUPPLY_STATUS 41 Batterie : Manufacturer $POWER_SUPPLY_MANUFACTURER 42 . 43 done 44 ) | sauver 45