getInfo 2.61.0

This commit is contained in:
kyodev 2017-12-11 16:21:06 +01:00
parent fb08b46337
commit b0ec4d3925
2 changed files with 166 additions and 83 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=2.60.0
version=2.61.0
date="9/12/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -570,7 +570,7 @@ toDisplay=(
echo -e "$STD\n plus d'infos: $GREEN$urlNotice\n$STD"
}
# f_pr "1|1|2|l1|l2|l3|titre1|titre2|hl|quote|flush" "texte" '[CONDITION test]'
# f_pr "1||2|3|l1|l2|l3|titre1|titre2|titre3|hl|quote|flush|code" "texte" '[CONDITION test]'
# $1:
# 1|2|3 indentation, liste à puce, une puce par ligne
# l1|l2|l3 ligne, indentation, avec espaces
@ -582,7 +582,7 @@ toDisplay=(
# "[ \"$1\" != \"notitre\" ]" ou "[ $1 != notitre ]" (attention au manque de ")
# flush (f_pr flush) inutile si f_d(x) final
# $1 type, $2 texte, [$3] test /!\ assigne la variable parent $text
f_pr(){ # 1/12/2017
f_pr(){ # 11/12/2017
local preline='' line='' endline=" \n"
[[ "$1" == 'titre1' ]] && preline="\n# "
@ -604,6 +604,8 @@ f_pr(){ # 1/12/2017
if [[ "$1" == "hl" ]]; then # <hl>
text+="\n---\n\n"
elif [[ "$1" == "code" ]]; then # ```
text+='```\n'
elif [[ "$1" ]]; then
text+="$preline$line$endline" # ligne formatée
else
@ -745,7 +747,7 @@ fi_conf(){ # 3/12/2017
f_di cmd "$confs" "grep -Ersv '^#|^$' <fichiers désirés>"
}
fi_cpu(){ # 6/12/2017
fi_cpu(){ # 11/12/2017
local cpu_flags text iflag qte_flags text_flags="" pluriel
local alert_microcode
@ -769,7 +771,7 @@ fi_cpu(){ # 6/12/2017
alert_microcode="$fg_ucode"
[ "$ENV_DEBIAN" ] && alert_microcode+="\n les installer: **apt install $ucode**"
fi
[ $(( ${fg_cpu:0:1} )) -gt 1 ] && pluriel="s" || unset pluriel
[ "$(( ${fg_cpu:0:1} ))" -gt 1 ] && pluriel="s" || unset pluriel
###
f_pr titre2 "processeur"$pluriel
f_di cmd "$fg_cpu" "lscpu" # affichage proc
@ -954,7 +956,7 @@ fi_efi(){ # 6/12/2017
}
# assigne $fe_gpu (liste des gpu), $fe_nb_gpu, fe_Xorg, si [$1=silent|xorgOnly], sortie après configs xorg complete
fi_gpu(){ # 8/12/2017
fi_gpu(){ # 11/12/2017
local cards cmd_cards prefixCmd openGl pluriel text
local stck_glxinfo glx_dvc cmd_glx_dvc stck_glxinfoOpt stck_glxinfoDri glx_dvc_temp
local cmd_openGl resolutions cmd_resolutions cmt_resolutions providers cmd_providers
@ -1091,7 +1093,7 @@ fi_gpu(){ # 8/12/2017
f_pr
# nb écran & résolution(s) active(s)
f_pr l "nombre d'écrans: **$fg_nb_screen**"
[ $( f__wcv "-wv" "$fg_resolution" "pixels" ) -gt 1 ] && pluriel="s" || unset pluriel
[ "$( f__wcv "-wv" "$fg_resolution" "pixels" )" -gt 1 ] && pluriel="s" || unset pluriel
f_pr l "résolution"$pluriel" active"$pluriel": **$fg_resolution**"
f_pr
# lspci -nnv
@ -1152,7 +1154,7 @@ fi_hw(){ # 6/12/2017
f_pr flush
}
fi_journal(){ # 2/12/2017
fi_journal(){ # 10/12/2017
local jctl_boot jctl_alert_k jctl_crit_k jctl_err_k jctl_warn_k jctl_warn_nok jctl_last jctl_size file
local info_ucode text nb_lignes=25
local alert_jctl_persist alert_firmBug
@ -1255,13 +1257,13 @@ fi_journal(){ # 2/12/2017
f_pr
f_di cmd "$jctl_size" "journalctl --disk-usage " "taille des journaux"
# dernières lignes
f_di cmd "$jctl_last" "journalctl --no-pager --no-hostname -b0 -p 4 -n25" \
f_di cmd "$jctl_last" "journalctl --no-hostname -b0 -p 4 -n25" \
"**toutes provenance, emergency-warning**, $nb_lignes lignes les plus **récentes**"
f_dspl_alrt "$alert_firmBug" "alert"
f_dspl_alrt "$info_ucode" "info"
}
fi_locale(){ # 6/12/2017
fi_locale(){ # 10/12/2017
local localeConf localeCtl locale timezone timedatectl xKeyboardMap keyboard text
local alert_rtc alert_ntp
@ -1302,7 +1304,7 @@ fi_locale(){ # 6/12/2017
f_di cmd "$locale" "locale"
# timezone
f_di cmd "$timezone" "grep -EHsv '#|^$' /etc/timezone*"
f_di cmd "$timedatectl" "timedatectl status --no-pager"
f_di cmd "$timedatectl" "timedatectl status"
f_dspl_alrt "$alert_ntp" "info"
f_dspl_alrt "$alert_rtc" "alert"
# keyboard layout
@ -1490,7 +1492,7 @@ fi_packagers(){ #v2 23/11/2017
fi
}
fi_pkg_apt(){ #v3 9/12/2017
fi_pkg_apt(){ #v3 11/12/2017
local dateMaj nb_packages ifile info_update text pluriel
local sources cmt_sources cmd_sources
local apt_v apt_version apt_prefs cmt_apt_prefs cmd_apt_prefs
@ -1583,7 +1585,7 @@ fi_pkg_apt(){ #v3 9/12/2017
qte_upgradable=($( gawk '/ newly installed/{print $1" "$10}' <<< $stck_upgd )) # tableau
[ "${qte_upgradable[0]}" ] || qte_upgradable=("-1" "-1") # si erreur
# upgrade
[ $(( "${qte_upgradable[0]}" )) -gt 1 ] && pluriel="s" || unset pluriel
[ "$(( "${qte_upgradable[0]}" ))" -gt 1 ] && pluriel="s" || unset pluriel
cmt_upgrade="${qte_upgradable[0]} paquet"$pluriel" à mettre à jour"
[ "${qte_upgradable[0]}" -eq 0 ] && cmt_upgrade=${cmt_upgrade/0 /aucun }
cmd_upgrade="apt list --upgradable"
@ -1602,7 +1604,7 @@ fi_pkg_apt(){ #v3 9/12/2017
notUpgraded=${notUpgraded#*The following packages have been kept back:} # suppression début
notUpgraded=$( sed '/newly/d' <<< "$notUpgraded" | sort | tr '\n' ' ' )
notUpgraded=${notUpgraded// / } # suppression espace double
[ $(( "${qte_upgradable[1]}" )) -gt 1 ] && pluriel="s" || unset pluriel
[ "$(( "${qte_upgradable[1]}" ))" -gt 1 ] && pluriel="s" || unset pluriel
cmt_notUpgraded="${qte_upgradable[1]} paquet"$pluriel" nécessitant une mise à jour profonde)"
alert_full_upgrade="ces paquets peuvent être mis à jour avec avec: **apt full-upgrade**"
fi
@ -1612,7 +1614,7 @@ fi_pkg_apt(){ #v3 9/12/2017
toRemove=$( sort <<< $toRemove )
qte_toRemove=$( gawk '/ newly installed/{ printf $6 }' <<< $toRemove )
toRemove=$( sed '/newly/d' <<< "$toRemove" ) # suppression ligne état
[ $(( "$qte_toRemove" )) -gt 1 ] && pluriel="s" || unset pluriel
[ "$(( "$qte_toRemove" ))" -gt 1 ] && pluriel="s" || unset pluriel
cmt_toRemove="$qte_toRemove paquet"$pluriel" inutile"$pluriel
[ "$qte_toRemove" -eq 0 ] && cmt_toRemove=${cmt_toRemove/0 /aucun }
cmd_toRemove="apt autoremove --simulate"
@ -1853,80 +1855,117 @@ fi_pkg_x(){ #v2 1/12/2017
f_di var "$alert_pkg_todo" "aide souhaitée"
}
fi_reseau(){ # 1/12/2017 ( configuration )
local ip_a iwconfig interfaces route resolv canal_wifi ifx text pluriel
local alert_ifconfig
fi_reseau(){ # 11/12/2017 ( configuration )
local ip_a interfaces route resolv iwconfig canal_wifi netmgr imgr netmgrinst netmgrrun text pluriel
local ipa slaac='' slaac_mac=''
local alert_ifconfig alert_slaac
# ip a & route
ip_a=$( ip a | sed '/link\/ether/d; /valid_lft/d' ) # filtre sur adr MAC & bail
# ip_a=$( sed '/inet6.*scope global/d; /inet6.*scope link/d' <<< $ip_a ) # filtre sur inet6 scope global & scope link (fe80::)
ip_a=$( sed '/inet6.*/d' <<< $ip_a ) # filtre sur inet6)
route=$( ip route show )
ip_a=$( ip a | sed '/link\/ether/d; /link\/loopback.*/d' ) # filtre adr MAC link (lo)
ip_a=$( sed '/valid_lft forever preferred_lft forever/d' <<< $ip_a )
route=$( sort <<< $( ip -4 route show ) )$'\n\n'
route+=$( ip -6 route show )
# interfaces & resolv
interfaces=$( f_grep_file "/etc/network/interfaces*" )
interfaces=$( sed -E 's/wpa-psk [[:graph:]]+/wpa-psk <WPA key removed>/; s/:/: /' <<< $interfaces )
resolv=$( f_grep_file "/etc/resolv.conf" "notitre" )
# iwconfig (/sbin)
if [ $( f__which iwconfig ) ]; then #paquet wireless-tools requis
iwconfig=$( LC_ALL=C iwconfig 2>&1 | grep -v 'no wireless extensions' | grep -v '^[[:space:]]*$' )
iwconfig=$( LC_ALL=C iwconfig 2>/dev/null )
fi
# iwlist (/sbin)
if [ $( f__which iwlist ) ]; then # canal wifi utilisé; /sbin, paquet wireless-tools requis
canal_wifi=$( LC_ALL=C iwlist chan 2>&1 | grep 'Current Frequency' | grep -Eio 'channel [0-9]+' )
canal_wifi=$( LC_ALL=C iwlist chan 2>/dev/null | grep 'Current Frequency' | grep -Eio 'channel [0-9]+' )
fi
# network manager
netmgrpaths=("/usr/sbin/NetworkManager" "/usr/sbin/wicd" "/usr/sbin/connmand") # thanks wireless-info
netmgrnames=("NetworkManager" "Wicd" "ConnMan")
for ifx in "${!netmgrpaths[@]}"; do
[ -e "${netmgrpaths[$ifx]}" ] && netmgrinst+=${netmgrnames[$ifx]}
if [ $( ps -ef | grep -c ${netmgrpaths[$ifx]} ) -ge 2 ]; then
netmgrrun+="$(ps -ef | grep -o "${netmgrpaths[$ifx]}.*$" | head -n 1)"
# manager réseaux
declare -A netmgr=(
["NetworkManager"]="/usr/sbin/NetworkManager"
["Wicd"]="/usr/sbin/wicd"
["ConnMan"]="/usr/sbin/connmand"
)
for imgr in ${!netmgr[*]}; do
if [ -e "${netmgr[$imgr]}" ]; then
netmgrinst+="$imgr "
fi
if [ $( ps -ef | grep -c ${netmgr[$imgr]} ) -ge 2 ]; then
netmgrrun+=$( ps -ef | grep -om1 "${netmgr[$imgr]}"".*$" )$'\n'
fi
done
netmgrinst=${netmgrinst% } # suppression dernier espace
netmgrrun=${netmgrrun%[[:cntrl:]]} # suppression dernier $'\n'
# alertes
if [ $( f__which ifconfig ) ] ; then
alert_ifconfig="ifconfig [net-tools](https://github.com/giftnuss/net-tools) est un projet abandonné "
alert_ifconfig+="depuis des années. iproute2 (linuxfoundation) le remplace."
fi
[ "$fg_ip" ] || figet_ip
local ip4 gw4 ip6 gw6
figet_ip "-4"
ip4="$fg_ip"
gw4="$fg_gws"
figet_ip "-6"
ip6="$fg_ip"
gw6="$fg_gws"
for ipa in $ip6 ; do
if grep -q 'ff:fe:' <<< "$ipa"; then
adr_temp=$( grep -o '^.*ff:fe:.* (.*$' <<< "$ipa" )
adr_temp=${adr_temp%/*}
slaac+="$adr_temp"$'\n'
adr_temp=${adr_temp#*: }
slaac_mac+=${adr_temp/ff:fe:}
fi
done
if [ "$slaac" ]; then
[ "$( f__wcv -l "$slaac" )" -gt 1 ] && pluriel="s" || unset pluriel
slaac_mac=${slaac_mac% ø } # suppression dernier ' ø '
slaac=${slaac%[[:cntrl:]]} # suppression dernier $'\n'
alert_slaac="adresse"$pluriel" ipv6 autoconfigurée"$pluriel" (mode SLAAC): \n"
alert_slaac+="$slaac\n"
alert_slaac+="mais adresse"$pluriel" MAC ($slaac_mac) visible"$pluriel". cela permet potentiellement de "
alert_slaac+="suivre et de tracer ce PC sur les réseaux. \n"
alert_slaac+="à vérifier si cet état est souhaité."
fi
###
f_pr titre2 "configuration"
# ip locales avec type
[ $(f__wcv "-l" "$fg_ip_tp") -gt 1 ] && pluriel="s" || unset pluriel
f_di sans "$fg_ip_tp" "" "IP locale"$plurielD
f_pr code
f_pr l1 "ipv4"
f_pr l2 "$ip4"
f_pr
[ "$(f__wcv "-l" "$fg_gws")" -gt 1 ] && pluriel="s" || unset pluriel
f_pr l2 "passerelle"$pluriel": ${gw4//$'\n'/ ⊗ }"
f_pr
figet_ip "-6"
f_pr l1 "ipv6"
f_pr l2 "$ip6"
f_pr
[ "$(f__wcv "-w" "$fg_ifn_prior")" -gt 1 ] && pluriel="s" || unset pluriel
f_pr l2 "interface"$pluriel" sortante"$pluriel": $fg_ifn_prior" '[ "$fg_ifn_prior" ]'
f_pr
f_pr l2 "passerelles: ${gw6//$'\n'/ ⊗ }"
f_pr code
f_pr
f_pr 1 "les adresses Mac peuvent être affichées avec \`$DIRNAME""getInfo --mac\`"
f_pr 1 "l'IP publique peut être connue avec: \`$DIRNAME""getInfo --ip\`"
f_pr
# gateways
[ $(f__wcv "-l" "$fg_gws") -gt 1 ] && pluriel="s" || unset pluriel
f_di sans "$fg_gws" "" "Passerelle"$pluriel
# interface se sortie
if [ $(wc -w <<< $fg_ifn) -gt 1 ]; then
f_di sans "$fg_ifn_prior" "" "interface de sortie"
fi
# ip a & route & interface & resolv
f_di cmd "$ip_a" "ip address" "sans ipV6 et sans adresses MAC"
f_di cmd "$ip_a" "ip address"
f_di cmd "$route" "ip route show"
f_di cmd "$interfaces" "grep -EHrsv '#|^$' /etc/network/interfaces*" "configuration manuelle"
f_di cmd "$resolv" "cat /etc/resolv.conf" "serveurs de noms DNS utilisés"
# iwconfig & iwlist
f_di cmd "$iwconfig" "iwconfig" "état carte wifi"
if [ "$canal_wifi" ]; then
f_di cmd "$canal_wifi" "iwlist chan | grep 'Current Frequency' | grep -Eio 'channel [0-9]+'" \
"canal wifi utilisé"
f_pr 1 "la configuration ssid utilisée peut être connue (si NetworkManager) avec \n \`$DIRNAME""getInfo --ssid\`"
f_pr
fi
f_di cmd "$iwconfig" "/sbin/iwconfig 2>/dev/null" "état carte wifi"
f_di cmd "$canal_wifi" "/sbin/iwlist chan | grep 'Current Frequency' | grep -Eio 'channel [0-9]+'" \
"canal wifi utilisé"
f_pr 1 "la configuration ssid utilisée peut être connue (si NetworkManager installé) avec \n \`$DIRNAME""getInfo --ssid\`"
f_pr
# network manager
f_pr 1 "gestionnaire de réseau"
if [ "$netmgrinst" ]; then
[ $(wc -w <<< $netmgrinst) -gt 1 ] && pluriel="s" || unset pluriel
f_pr 2 "installé"$pluriel": **$netmgrinst**"
f_pr 2 "en fonctionnement: **$netmgrrun**"
else
f_pr 2 "non trouvé parmi: ${netmgrnames[@]}"
fi
f_dspl_alrt "$alert_ifconfig" "info"
f_pr 1 "gestionnaire de réseau" '[ "$netmgrinst" ]'
[ "$(wc -w <<< $netmgrinst)" -gt 1 ] && pluriel="s" || unset pluriel
f_pr 2 "installé"$pluriel": **$netmgrinst**" '[ "$netmgrinst" ]'
f_pr 2 "en fonctionnement: **$netmgrrun**" '[ "$netmgrrun" ]'
f_pr 2 "non trouvé parmi: ${!netmgr[*]}" '[ -z "$netmgrrun" ]'
f_pr flush
f_dspl_alrt "$alert_ifconfig" "info"
f_dspl_alrt "$alert_slaac" "info"
}
fi_serial(){ #v9 1/12/2017
@ -1954,12 +1993,15 @@ fi_serial(){ #v9 1/12/2017
echo -e "$text\n"
}
fi_ssid(){ #v2 1/12/2017
fi_ssid(){ #v2 11/12/2017
local nm_ssid text
local fileOutput="/tmp/$RANDOM-$RANDOM" # ré-assigne sortie pour f_di
[ "$EUID" -eq 0 ] || f__error "Root requis"
[ $( f__which nmcli ) ] || f__error "NetworkManager requis"
# connexion wifi?
/sbin/iwconfig 2>/dev/null | grep -iq ssid || f__error "pas de connexion en wifi"
nm_ssid=$( f_grep_file "/etc/NetworkManager/system-connections/*" "lignevide" )
###
f__info "$RED""Attention:$BLUE la clé du réseau wifi est visible"
@ -3133,26 +3175,55 @@ figet_hw(){ #v2 31/10/2017
[ "$fg_hw" ] && fg_hw=${fg_hw::-1}
}
# assigne $fg_ip, $fg_ip_tp, $fg_gws, $fg_gws_tp, $fg_ifn_prior, $fg_ifn, $fg_mac, fg_mac_tp
figet_ip(){ # 27/11/2017
local ifn
# assigne $fg_ip, $fg_gws6, $fg_ifn, $fg_mac
figet_ip(){ # 11/12/2017
local target ifn
[ $( f__which ip ) ] || return 1
fg_ip="$(sed '/[[:digit:]]:[[:blank:]]lo.*inet/d; /inet6.*scope/d' <<< $(ip -o a) | gawk '{print " ",$4,"(",$2,")"}')"
fg_ip_tp="$(sed -E 's/(^.*wl.*)/\1 (wifi)/;s/(^.*en.*|^.*eth.*)/\1 (ethernet)/' <<< $fg_ip)"
fg_gws="$(LC_ALL=C ip -4 route | gawk '/default via/ {print " ",$3,"(",$5,")"}')"
fg_gws+="$(LC_ALL=C ip -6 route | gawk '/default via/ {print " ",$3,"(",$5,")"}')"
fg_gws_tp="$(sed -E 's/(^.*wl.*)/\1 (wifi)/;s/(^.*en.*|^.*eth.*)/\1 (ethernet)/' <<< $fg_gws)"
fg_ifn_prior="$(ip route get 255.255.255.255 | sed -nr 's/.*src ([0-9.]+).*/\1/p')"
for ifn in $(ls /sys/class/net/) ; do
[ "$ifn" != "lo" ] && fg_ifn+=" $ifn"$'\n'
[ "$ifn" != "lo" ] && fg_mac+=" $ifn: $(cat /sys/class/net/$ifn/address)"$'\n'
[ "$1" ] && proto="$1" || proto="-4"
# adresses ip
fg_ip=$(
gawk -v proto="$proto" '
BEGIN { if (proto == -6) esp=41; else esp=16 }
/scope global/ {
sub(/wl.*/,$2" (wifi)",$2); sub(/.*en.*|.*eth.*/,$2" (ethernet)",$2);
match($0,/scope .*\\/); scope=substr($0,RSTART,RLENGTH)
sub(/scope /,"",scope); sub(/\\/,"",scope)
match($0,/preferred_lft .*sec/); lft=substr($0,RSTART,RLENGTH)
sub(/sec/,"s",lft); sub(/preferred_lft/,"lft",lft)
printf "%-17s: %-"esp"s (%s) %s \n",$2,$4,lft,scope }
/fe80::/ {
sub(/wl.*/,$2" (wifi)",$2)
match($0,/scope .* \\/); scope=substr($0,RSTART,RLENGTH); sub(/scope /,"",scope); sub(/ \\/,"",scope)
link=link"\n"sprintf("%-17s: %-22s %s",$2,$4,scope) }
/ lo / { lo=sprintf("%s (loopback) : %s",$2,$4) }
END { printf "%s\n%s",link,lo }
' <<< $( ip $proto -o address )
)
# passerelles
fg_gws=$(
gawk '
BEGIN { if (proto == -6) esp=42; else esp=12 }
/default via/ { printf "%-"esp"s (%s)\n",$3,$5 }
' <<< $( ip $proto route )
)
# interface sortante
if [ "$proto" == "-6" ]; then
target=$( gawk '/proto ra / { print $1; exit}' <<< $( ip $proto -o route ) )
fg_ifn_prior=$( ip $proto route get $target | sed -En 's/.*dev (.*) proto.*src ([0-9a-f:]+).*/\1/p' )
else
fg_ifn_prior=$( ip $proto route get 255.255.255.255 | sed -En 's/.*dev (.*) src ([0-9.]+) .*/\1 \2/p' )
fi
# ifnames & mac
fg_ifn="" fg_mac=""
for ifn in $( ls /sys/class/net/ ) ; do
if [ "$ifn" != "lo" ]; then
fg_ifn+="$ifn "
fg_mac+="$ifn: $( cat /sys/class/net/$ifn/address )"$'\n'
fi
done
# fg_ifn="$(sed '/^[[:blank:]]*$/d' <<< $fg_ifn)" # suppression lignes vides
# fg_mac="$(sed '/^[[:blank:]]*$/d' <<< $fg_mac)" # suppression lignes vides
# voir cat /sys/class/net/wlp1s0/uevent
fg_mac_tp="$(sed -E 's/(^.*wl.*)/\1 (wifi)/;s/(^.*en.*|^.*eth.*)/\1 (ethernet)/' <<< $fg_mac)"
fg_ifn=${fg_ifn%[[:cntrl:]]} # suppression dernier $'\n'
fg_mac_tp=${fg_mac_tp%[[:cntrl:]]} # suppression dernier $'\n'
fg_ifn=${fg_ifn% } # suppression dernier espace
fg_mac=${fg_mac%[[:cntrl:]]} # suppression dernier $'\n'
}
# $1=4|6, assigne $fg_public
@ -3659,7 +3730,7 @@ fipaste_curl_pastery(){ # 25/10/2017
f__info "merci contacter $projet, $contact pour aider à parfaire le script"
else
id="$(echo $curl | cut -d '"' -f 4)"
[ $(( "$pasteDuration" )) -gt 1 ] && pluriel="s" || unset pluriel
[ "$(( "$pasteDuration" ))" -gt 1 ] && pluriel="s" || unset pluriel
f__info "votre paste:$GREEN https://www.pastery.net/$id/" \
"(valide pendant $RED$pasteDuration jour"$pluriel")"
echo -e "exporté sur https://www.pastery.net/$id/ \n\n" >> "$fileOutput"
@ -3844,7 +3915,13 @@ prg_init(){ # 4/12/2017
[ "$BASH_VERSINFO" == 4 ] || f__error "bash v4 requis" "version installée: $BASH_VERSION"
# test /proc
[ -e /proc/cpuinfo ] || f__error "/proc/cpuinfo non trouvé" "/proc ne doit pas être monté"
if [ ! -e /proc/cpuinfo ]; then
if ! mount | grep -q "type proc"; then
f__error "/proc non monté"
else
f__error "/proc/cpuinfo non trouvé"
fi
fi
# test OS
OS=$(uname -s)
@ -3875,7 +3952,7 @@ prg_init(){ # 4/12/2017
fi
# requis pour fonctionnement programme
f__requis "gawk wget ip>iproute2 lspci>pciutils wc>coreutils" || exit 1
f__requis "gawk wget ip>iproute2 lspci>pciutils wc>coreutils uptime>procps" || exit 1
# detect rapide systeme deb
[ $( f__which dpkg ) ] && ENV_DEBIAN="oui"
@ -4013,7 +4090,7 @@ for j in $options; do
ORIGIN='test'
prg_1 "$*"
echo -n "•"
fi_packagers
fi_reseau
echo; f_dspl_md "$fileOutput"
exit ;; # test
-c* | all )
@ -4060,7 +4137,7 @@ for j in $options; do
exit ;; # affiche ip public
--mac )
figet_ip
f__info "fg_mac:\n$GREEN$fg_mac_tp"
f__info "fg_mac:\n$GREEN$fg_mac"
exit ;; # affiche adresses mac
--serial )
fi_serial

View File

@ -1,5 +1,11 @@
# changelog getInfo
## getInfo 2.61.0 11/12/2017
* révision figet_ip
* révision fi_réseau +ipv6, alert slaac+mac
* révision, fi_ssid, détection connexion wifi
## getInfo 2.60.0 9/12/2017
* révision: fi_system si plusieurs batteries