Commit 3ed613b7 authored by kyodev's avatar kyodev

maj

parent 88ccc110
Pipeline #58194 passed with stages
in 25 seconds
# getInfo
![version: 4.8.0](https://img.shields.io/badge/version-4.8.0-blue.svg?longCache=true&style=for-the-badge)
![version: 4.8.1](https://img.shields.io/badge/version-4.8.1-blue.svg?longCache=true&style=for-the-badge)
![bash langage](https://img.shields.io/badge/bash-4-brightgreen.svg?longCache=true&style=for-the-badge)
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
......
# getIp
![version: 2.14.2](https://img.shields.io/badge/version-2.14.2-blue.svg?longCache=true&style=for-the-badge)
![version: 2.15.1](https://img.shields.io/badge/version-2.15.1-blue.svg?longCache=true&style=for-the-badge)
![bash langage](https://img.shields.io/badge/bash-4-brightgreen.svg?longCache=true&style=for-the-badge)
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
......
# ipupdate
![version: 1.2.0](https://img.shields.io/badge/version-1.2.0-blue.svg?longCache=true&style=for-the-badge)
![version: 1.3.0](https://img.shields.io/badge/version-1.3.0-blue.svg?longCache=true&style=for-the-badge)
![bash langage](https://img.shields.io/badge/bash-version4-brightgreen.svg)
![status](https://img.shields.io/badge/status-release-green.svg)
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg)
......
......@@ -5,7 +5,7 @@
# SC2016 Expressions don't expand in single quotes
# SC2009 Consider using pgrep instead of grepping ps output
version=4.8.0
version=4.8.1
date="18/06/2018"
script="getInfo"
contact="IRC freenode.net ##sdeb@freenode.net ou https://framagit.org/sdeb/getInfo/issues"
......@@ -410,7 +410,7 @@ f__wget_test(){ # 07/06/2018
exit 0
}
f_affichage(){ # 15/06/2018
f_affichage(){ # 18/06/2018
(( x_logo == 1 )) && return
x_logo=1
......@@ -421,7 +421,7 @@ f_affichage(){ # 15/06/2018
__ _ ___| |_|_ _|_ __ / _| ___
/ _' |/ _ \ __|| || '_ \| |_ / _ \
| (_| | __/ |_ | || | | | _| (_) |
\__, |\___|\__|___|_| |_|_| \___/ $STD$script_options
\__, |\___|\__|___|_| |_|_| \___/ $STD$script_options$BLUE
|___/ ${YELLOW}version $version - $date$STD
end
......@@ -495,7 +495,7 @@ f_dspl_alrt(){ # 07/03/2018
# option 'sources', les .sources avec largeur fixe 1ère colonne (format deb822)
# option 'sources', affiche les fichiers !(*.sources) en colonne selon leur largeur maxi
# commande de base: grep -Ersv '^#|^$' file|dossier "options"
f_grep_file(){ # 08/03/2018
f_grep_file(){ # 18/06/2018
local motifBase="^[[:blank:]]*#" motif file content largeur un deux trois quatre cinq six sept huit reste
local col1=0 col2=0 col3=0 col4=0 col5=0 col6=0 col7=0 col8=0 display=''
......@@ -560,7 +560,6 @@ f_grep_file(){ # 08/03/2018
display+=" ‣ vide"$'\n\n'
fi
done
#~ display=${display%%[[:space:]]} # suppression dernier \n
display=${display%$'\n'} # suppression dernier \n
if [ -z "$display" ]; then
display="nofile" # si display vide, inscription 'nofile'
......@@ -662,9 +661,9 @@ f_ip_pub(){ # 17/06/2018
[[ "$1" == @(-4|4) ]] && proto="-4"
[[ "$1" == @(-6|6) ]] && proto="-6"
type -p host &>>/dev/null && cmds+=( "f_n_host nostd " ) # deprecated
#~ type -p dig &>/dev/null || type -p drill &>/dev/null && cmds+=( "f_n_dig nostd" )
#~ type -p wget &>/dev/null && cmds+=( "wget --user-agent=$user_agent --quiet --timeout=1 --tries=1 -o /dev/null -O -" )
#~ type -p curl &>/dev/null && cmds+=( "curl --silent --location --retry 0 --max-time 1" )
type -p dig &>/dev/null || type -p drill &>/dev/null && cmds+=( "f_n_dig nostd" )
type -p wget &>/dev/null && cmds+=( "wget --user-agent=$user_agent --quiet --timeout=1 --tries=1 -o /dev/null -O -" )
type -p curl &>/dev/null && cmds+=( "curl --silent --location --retry 0 --max-time 1" )
if (( ${#cmds[@]} == 0 )); then
echo "f_ip_pub(): no available commands (host|dig|drill|wget|curl)" >&2
return 1
......@@ -805,11 +804,11 @@ f_n_cnx(){ # 17/06/2018
# dig has priority over drill if the two command are presents
# type : aaaa | a | txt | soa | mx | AAAA | A | TXT | SOA | MX , A by default
# option nostd, for dig only: +timeout=1 +retry=1
f_n_dig(){ # 17/06/2018
f_n_dig(){ # 18/06/2018
local ini options type='A' server hostname cmd line ip
! type -p dig &>/dev/null && ! type -p drill &>/dev/null && return 1
(( $# == 0 )) && return
(( $# == 0 )) || [ "$1" == test ] && return
ini=$( shopt -p nocasematch )
shopt -s nocasematch
while (( $# )) ; do
......@@ -833,17 +832,14 @@ f_n_dig(){ # 17/06/2018
if [[ ${line[0]}${line[2]}${line[3]} == ${hostname}\.IN$type ]]; then
ip+="${line[(( ${#line[@]} - 1 ))]%\.} "
if [[ "$type" == @(SOA|TXT) ]]; then
ip="${line[4]}"
ip="${line[4]%\.}"
fi
fi
done <<< "$cmd"
ip="${ip% }"
fi
if [[ "$type" == @(SOA|TXT) ]]; then
#~ ip=${ip%.} # soa
ip=${ip%\"} # txt
ip=${ip#\"} # txt
fi
ip=${ip%\"} # txt
ip=${ip#\"} # txt
eval "$ini"
echo "$ip"
if [ "$ip" == "n/a" ]; then
......@@ -854,11 +850,11 @@ f_n_dig(){ # 17/06/2018
# options: hostname [@server|type|nostd], display ip | n/a (equivalent to dig + short), return 0|1
# type : aaaa | a | txt | soa | mx | AAAA | A | TXT | SOA | MX , A by default
# option nostd: -R1 -W1
f_n_host(){ # 17/06/2018
f_n_host(){ # 18/06/2018
local ini type='A' options server hostname ip line
! type -p host &>/dev/null && return 1
(( $# == 0 )) && return
(( $# == 0 )) || [ "$1" == test ] && return
ini=$( shopt -p nocasematch )
shopt -s nocasematch
while (( $# )) ; do
......@@ -873,9 +869,8 @@ f_n_host(){ # 17/06/2018
while read -r -a line; do
if (( ${#line[@]} > 3 )); then
ip+="${line[(( ${#line[@]} - 1 ))]%\.} " # last field
#~ if [[ "$type" == @(SOA|TXT) ]]; then
if [[ "$type" == SOA ]]; then
ip="${line[4]}"
ip="${line[4]%\.}"
fi
fi
done <<< "$( LC_ALL=C host "${options[@]}" -t "${type[@]}" "$hostname" "${server[@]}" )"
......@@ -884,7 +879,6 @@ f_n_host(){ # 17/06/2018
[[ $ip =~ has\ no\ $type\ record ]] && ip='no record'
ip=${ip%\"} # txt
ip=${ip#\"} # txt
eval "$ini"
echo "$ip"
if [[ "$ip" == 'not found' || "$ip" == 'no record' ]]; then
......@@ -1397,7 +1391,7 @@ fi_efi(){ # 06/03/2018
}
# [$1=silent|xorgOnly], assigne $fe_gpu (liste des gpu), $fe_nb_gpu, fe_Xorg (peut être null)
fi_gpu(){ # 08/04/2018
fi_gpu(){ # 18/06/2018
local toScrut confs ifile fileConfs cmd_confs cmt_confs info_config
local cards cmd_cards openGl pluriel text
local stck_glxinfo glx_dvc cmd_glx_dvc stck_glxinfoOpt stck_glxinfoDri glx_dvc_temp
......@@ -1429,10 +1423,9 @@ fi_gpu(){ # 08/04/2018
)
confs=$( f_grep_file "${toScrut[*]}" )
for ifile in "${toScrut[@]}"; do
[ -e "$ifile" ] && fileConfs+="$ifile " # ne pas quoter $ifile dans la condition pour permettre glob
[ -e "$ifile" ] && fileConfs+="$ifile " # ne pas quoter $ifile dans la condition pour permettre glob
done
cmd_confs="grep -Ersv '^#|^$' ${toScrut[*]}"
#~ [ "$fileConfs" ] || cmd_confs="Aucun fichier à afficher"
cmt_confs="configuration Xorg"
info_config="les configurations par défaut de Xorg se trouve dans **/usr/share/X11/xorg.conf.d/**, "
info_config+="non sorties ici."
......@@ -2784,13 +2777,12 @@ fi_system_analyse(){ # 06/03/2018
f_dspl cmd:text "$bootGraph" "$cmd_bootGraph" "$cmt_bootGraph"
}
fi_system_rc(){ # 12/03/2018
fi_system_rc(){ # 18/06/2018
local if_actif iip ip_act
if_actif=$( ip -o link | awk '/state UP/{sub(/:/,"",$2); printf "%s ",$2}' )
for iip in $if_actif; do
ip_act+=$( ip -o address show dev "$iip" | awk '
#~ /inet/ { sub(/wl.*/,"wifi: "$2,$2); sub(/en.*|eth.*/,"rj45: "$2,$2); sub(/\/.*/,"", $4) }
/inet/ { sub(/\/.*/,"", $4) }
/inet6/ { ip6 = $4; exit }
/inet / { ip4 = $4 }
......@@ -4946,7 +4938,7 @@ for i in "${!options[@]}"; do
# fi_reseau fi_nm
# fi_system_analyse fi_journal_xorg fi_journal
#~ fi_system
fi_disk
fi_system
echo
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi ;;
-c ) exec "$0" "menu" ;; # menu catégorie
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment