mirror of https://framagit.org/kyodev/kyopages.git
maj
This commit is contained in:
parent
35a0036bec
commit
0d76584f3c
|
@ -109,7 +109,7 @@ getFirefox i-canal
|
||||||
* les canaux par ordre croissant de versions:
|
* les canaux par ordre croissant de versions:
|
||||||
` ESR <= release < beta = developer edition < nightly `
|
` ESR <= release < beta = developer edition < nightly `
|
||||||
* le canal **all** est fictif et comprend _esr+latest+beta+nightly_ pour l'installation (pas de _dev_ donc)
|
* le canal **all** est fictif et comprend _esr+latest+beta+nightly_ pour l'installation (pas de _dev_ donc)
|
||||||
* le canal **all** comprend toutes les versions installées pour les autres opérations
|
* le canal **all** comprend toutes les versions installées, pour les autres opérations
|
||||||
* pour chaque canal, une option permet de **copier** un éventuel profil _.default_.
|
* pour chaque canal, une option permet de **copier** un éventuel profil _.default_.
|
||||||
le profil _.default_ existant est laissé en place.
|
le profil _.default_ existant est laissé en place.
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# getInfo
|
# getInfo
|
||||||
|
|
||||||
![version: 4.6.0](https://img.shields.io/badge/version-4.6.0-blue.svg?longCache=true&style=for-the-badge)
|
![version: 4.7.0](https://img.shields.io/badge/version-4.7.0-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)
|
![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)
|
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ chmod +x getInfo
|
||||||
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
||||||
| (_| | __/ |_ | || | | | _| (_) |
|
| (_| | __/ |_ | || | | | _| (_) |
|
||||||
\__, |\___|\__|___|_| |_|_| \___/
|
\__, |\___|\__|___|_| |_|_| \___/
|
||||||
|___/ version 4.6.0 - 16/06/2018
|
|___/ version 4.7.0 - 16/06/2018
|
||||||
|
|
||||||
•ø••••••••••••••••◇◇◇•••••
|
•ø••••••••••••••••◇◇◇•••••
|
||||||
|
|
||||||
|
@ -145,8 +145,8 @@ chmod +x getInfo
|
||||||
__ _ ___| |_|_ _|_ __ / _| ___
|
__ _ ___| |_|_ _|_ __ / _| ___
|
||||||
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
||||||
| (_| | __/ |_ | || | | | _| (_) |
|
| (_| | __/ |_ | || | | | _| (_) |
|
||||||
\__, |\___|\__|___|_| |_|_| \___/
|
\__, |\___|\__|___|_| |_|_| \___/ -h
|
||||||
|___/ version 4.6.0 - 16/06/2018
|
|___/ version 4.7.0 - 16/06/2018
|
||||||
|
|
||||||
./getInfo : exécution script
|
./getInfo : exécution script
|
||||||
getInfo : exécution script installé dans le système
|
getInfo : exécution script installé dans le système
|
||||||
|
@ -165,6 +165,7 @@ chmod +x getInfo
|
||||||
getInfo --ssid : affiche configurations ssid, pas de rapport markdown, root & NetworkManager requis
|
getInfo --ssid : affiche configurations ssid, pas de rapport markdown, root & NetworkManager requis
|
||||||
|
|
||||||
--debug : messages d'erreur (stderr) logués et exportés avec le rapport
|
--debug : messages d'erreur (stderr) logués et exportés avec le rapport
|
||||||
|
--dev : une version de dev du script (si existante) est recherchée
|
||||||
-tn : durée de conservation du paste de n jour(s)
|
-tn : durée de conservation du paste de n jour(s)
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
./getInfo -i : installation du script dans le système (root)
|
./getInfo -i : installation du script dans le système (root)
|
||||||
|
@ -173,7 +174,7 @@ chmod +x getInfo
|
||||||
getInfo -r, --remove : désinstallation du script (root)
|
getInfo -r, --remove : désinstallation du script (root)
|
||||||
getInfo --rrc : désinstallation gfetch (root)
|
getInfo --rrc : désinstallation gfetch (root)
|
||||||
getInfo -u, --upgrade : mise à jour script
|
getInfo -u, --upgrade : mise à jour script
|
||||||
getInfo -v, --version : version du script
|
getInfo -v, --version : version du script, installée et en ligne
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
plus d'infos: https://framaclic.org/h/doc-getinfo
|
plus d'infos: https://framaclic.org/h/doc-getinfo
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ de téléchargement) seront alors sous la forme `getInfo ...`.
|
||||||
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
||||||
| (_| | __/ |_ | || | | | _| (_) |
|
| (_| | __/ |_ | || | | | _| (_) |
|
||||||
\__, |\___|\__|___|_| |_|_| \___/
|
\__, |\___|\__|___|_| |_|_| \___/
|
||||||
|___/ version 4.6.0 - 16/06/2018
|
|___/ version 4.7.0 - 16/06/2018
|
||||||
|
|
||||||
getInfo -h : afficher l'aide
|
getInfo -h : afficher l'aide
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# getIp
|
# getIp
|
||||||
|
|
||||||
|
|
||||||
![version: 2.13.0](https://img.shields.io/badge/version-2.13.0-blue.svg?longCache=true&style=for-the-badge)
|
![version: 2.14.2](https://img.shields.io/badge/version-2.14.2-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)
|
![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)
|
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ script="getFirefox"
|
||||||
#contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFirefox/issues"
|
#contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFirefox/issues"
|
||||||
|
|
||||||
##### license LPRAB/WTFPL
|
##### license LPRAB/WTFPL
|
||||||
# auteur: simpledeb
|
# auteur: sdeb
|
||||||
# contributeurs: kyodev
|
# contributeurs: kyodev
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ script="getFlashPlayer"
|
||||||
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFlashPlayer/issues"
|
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFlashPlayer/issues"
|
||||||
|
|
||||||
##### license LPRAB/WTFPL
|
##### license LPRAB/WTFPL
|
||||||
# auteur: simpledeb
|
# auteur: sdeb
|
||||||
# contributeurs: kyodev, coyotus, naguam
|
# contributeurs: kyodev, coyotus, naguam
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
|
293
scripts/getInfo
293
scripts/getInfo
|
@ -7,7 +7,7 @@
|
||||||
# SC2009 Consider using pgrep instead of grepping ps output
|
# SC2009 Consider using pgrep instead of grepping ps output
|
||||||
# SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
|
# SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
|
||||||
|
|
||||||
version=4.6.0
|
version=4.7.0
|
||||||
date="16/06/2018"
|
date="16/06/2018"
|
||||||
script="getInfo"
|
script="getInfo"
|
||||||
contact="IRC freenode.net ##sdeb@freenode.net ou https://framagit.org/sdeb/getInfo/issues"
|
contact="IRC freenode.net ##sdeb@freenode.net ou https://framagit.org/sdeb/getInfo/issues"
|
||||||
|
@ -141,6 +141,59 @@ f__dialog_oui_non(){ # 14/06/2018
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# use dig or drill according to availability, options: hostname [@server|type|nostd|host], display ip | n/a (equivalent + short)
|
||||||
|
# if option --host, diplay hostname: ip
|
||||||
|
# dig has priority over dril if the two command are presents
|
||||||
|
# type : aaaa | a | txt | soa | any | mx | AAAA | A | TXT | SOA | ANY | MX
|
||||||
|
# option nostd for dig only: +timeout=1 +retry=1
|
||||||
|
f__dig(){ # 16/06/2018
|
||||||
|
local ini options type host server hostname dig ip domain ttl class typ ipx z
|
||||||
|
|
||||||
|
ini=$( shopt -p nocasematch )
|
||||||
|
if (( $# == 0 )); then
|
||||||
|
echo "f__dig: argument manquant"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
shopt -s nocasematch
|
||||||
|
while (( $# )) ; do
|
||||||
|
case "$1" in
|
||||||
|
nostd ) options+=( '+timeout=1' '+retry=1' ) ;;
|
||||||
|
aaaa | a | txt | soa | any | mx ) type="$1" ;;
|
||||||
|
host ) host='yes' ;;
|
||||||
|
@* ) server=( "$1" ) ;;
|
||||||
|
* ) hostname="$1" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
type="${type:=A}"
|
||||||
|
if type -p dig &>/dev/null; then
|
||||||
|
dig=$( dig "${options[@]}" "$hostname" "${server[@]}" "$type" )
|
||||||
|
elif type -p drill &>/dev/null; then
|
||||||
|
dig=$( drill "$hostname" "${server[@]}" "${type[@]}" )
|
||||||
|
else
|
||||||
|
echo "dig or drill command unavailable"
|
||||||
|
eval "$ini"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ $dig =~ answer:\ 0 ]]; then
|
||||||
|
dig='n/a'
|
||||||
|
elif [[ $dig =~ answer:\ 1 ]]; then
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
while read -r domain ttl class typ ipx z; do
|
||||||
|
if [[ $domain$class$typ == ${hostname}\.IN$type ]]; then
|
||||||
|
ip+="$ipx "
|
||||||
|
fi
|
||||||
|
done <<< "$dig"
|
||||||
|
dig="$ip"
|
||||||
|
fi
|
||||||
|
[ "$host" ] && echo -n "$hostname: "
|
||||||
|
echo "$dig"
|
||||||
|
eval "$ini"
|
||||||
|
if [ "$dig" == "n/a" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# $1=-c|-l|-lc, $2 répertoire, [$3] motif exclusion sur nom fichier, affiche 0|null si répertoire inexistant
|
# $1=-c|-l|-lc, $2 répertoire, [$3] motif exclusion sur nom fichier, affiche 0|null si répertoire inexistant
|
||||||
# -c: compte du nombre de fichiers dans un répertoire
|
# -c: compte du nombre de fichiers dans un répertoire
|
||||||
# -l: liste inline des noms de fichiers seuls (sans chemin) (similaire ls)
|
# -l: liste inline des noms de fichiers seuls (sans chemin) (similaire ls)
|
||||||
|
@ -466,7 +519,7 @@ f_affichage(){ # 15/06/2018
|
||||||
__ _ ___| |_|_ _|_ __ / _| ___
|
__ _ ___| |_|_ _|_ __ / _| ___
|
||||||
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
/ _' |/ _ \ __|| || '_ \| |_ / _ \
|
||||||
| (_| | __/ |_ | || | | | _| (_) |
|
| (_| | __/ |_ | || | | | _| (_) |
|
||||||
\__, |\___|\__|___|_| |_|_| \___/
|
\__, |\___|\__|___|_| |_|_| \___/ $STD$script_options
|
||||||
|___/ ${YELLOW}version $version - $date$STD
|
|___/ ${YELLOW}version $version - $date$STD
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -613,7 +666,7 @@ f_grep_file(){ # 08/03/2018
|
||||||
echo -en "$display"
|
echo -en "$display"
|
||||||
}
|
}
|
||||||
|
|
||||||
f_help(){ # 15/06/2018
|
f_help(){ # 16/06/2018
|
||||||
|
|
||||||
tput cuu1 # une ligne plus haut
|
tput cuu1 # une ligne plus haut
|
||||||
cat <<- end
|
cat <<- end
|
||||||
|
@ -635,6 +688,7 @@ f_help(){ # 15/06/2018
|
||||||
$BLUE$script --ssid :$STD affiche configurations ssid, pas de rapport markdown,$RED root & NetworkManager$STD requis
|
$BLUE$script --ssid :$STD affiche configurations ssid, pas de rapport markdown,$RED root & NetworkManager$STD requis
|
||||||
|
|
||||||
$GREEN --debug :$STD messages d'erreur (stderr) logués et exportés avec le rapport
|
$GREEN --debug :$STD messages d'erreur (stderr) logués et exportés avec le rapport
|
||||||
|
$GREEN --dev :$STD une version de dev du script (si existante) est recherchée
|
||||||
$GREEN -tn :$STD durée de conservation du paste de$GREEN n$STD jour(s)
|
$GREEN -tn :$STD durée de conservation du paste de$GREEN n$STD jour(s)
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
$BLUE./$script -i$STD : installation du script dans le système $RED(root)$STD
|
$BLUE./$script -i$STD : installation du script dans le système $RED(root)$STD
|
||||||
|
@ -643,7 +697,7 @@ f_help(){ # 15/06/2018
|
||||||
$BLUE$script -r$STD, --remove : désinstallation du script $RED(root)$STD
|
$BLUE$script -r$STD, --remove : désinstallation du script $RED(root)$STD
|
||||||
$BLUE$script --rrc$STD : désinstallation gfetch $RED(root)$STD
|
$BLUE$script --rrc$STD : désinstallation gfetch $RED(root)$STD
|
||||||
$BLUE$script -u$STD, --upgrade : mise à jour script
|
$BLUE$script -u$STD, --upgrade : mise à jour script
|
||||||
$BLUE$script -v$STD, --version : version du script
|
$BLUE$script -v$STD, --version : version du script, installée et en ligne
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
plus d'infos: $GREEN$url_notice$STD
|
plus d'infos: $GREEN$url_notice$STD
|
||||||
|
|
||||||
|
@ -651,8 +705,8 @@ f_help(){ # 15/06/2018
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1 [-4|-6], par défaut -4, affiche ip pub, return 1 on failure
|
# $1 [-4|-6], par défaut -4, affiche ip pub, return 1 on failure
|
||||||
# requiert f__cnx & f_ip_validate & f__random & f__log
|
# requiert f__cnx & f_ip_validate & f__random & f__log & f__dig
|
||||||
f_ip_pub(){ # 16/06/2018
|
f_ip_pub(){ # 16/06/2018-2
|
||||||
local proto="-4" ip_pub base_size cmd sequence xyz server user_agent="Mozilla/5.0 Firefox"
|
local proto="-4" ip_pub base_size cmd sequence xyz server user_agent="Mozilla/5.0 Firefox"
|
||||||
declare -a base cmds raw4 raw6 dns4 dns6
|
declare -a base cmds raw4 raw6 dns4 dns6
|
||||||
|
|
||||||
|
@ -707,18 +761,18 @@ f_ip_pub(){ # 16/06/2018
|
||||||
[[ "$1" == '-6' || "$1" == '6' ]] && proto="-6"
|
[[ "$1" == '-6' || "$1" == '6' ]] && proto="-6"
|
||||||
|
|
||||||
type -p host &>/dev/null && cmds+=( "host -R0 -W1 -t " ) # deprecated
|
type -p host &>/dev/null && cmds+=( "host -R0 -W1 -t " ) # deprecated
|
||||||
type -p dig &>/dev/null && cmds+=( "dig +short +timeout=1 +retry=1 " )
|
type -p dig &>/dev/null || type -p drill &>/dev/null && cmds+=( "f__dig nostd " )
|
||||||
type -p wget &>/dev/null && cmds+=( "wget --user-agent=$user_agent --quiet --timeout=1 --tries=1 -o /dev/null -O - " )
|
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 curl &>/dev/null && cmds+=( "curl --silent --location --retry 0 --max-time 1 " )
|
||||||
if (( ${#cmds[@]} == 0 )); then
|
if (( ${#cmds[@]} == 0 )); then
|
||||||
echo "f_ip_pub(): no available commands (host|dig|wget|curl)" >&2
|
echo "f_ip_pub(): no available commands (host|dig|drill|wget|curl)" >&2
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for cmd in "${cmds[@]}"; do
|
for cmd in "${cmds[@]}"; do
|
||||||
if [[ "$proto" == '-4' && "$cmd" =~ ^(host|dig) ]] ; then
|
if [[ "$proto" == '-4' && "$cmd" =~ ^(host|f__dig) ]] ; then
|
||||||
base=( "${dns4[@]}" )
|
base=( "${dns4[@]}" )
|
||||||
elif [[ "$proto" == '-6' && "$cmd" =~ ^(host|dig) ]] ; then
|
elif [[ "$proto" == '-6' && "$cmd" =~ ^(host|f__dig) ]] ; then
|
||||||
base=( "${dns6[@]}" )
|
base=( "${dns6[@]}" )
|
||||||
elif [[ "$proto" == '-4' && "$cmd" =~ ^(wget|curl) ]] ; then
|
elif [[ "$proto" == '-4' && "$cmd" =~ ^(wget|curl) ]] ; then
|
||||||
base=( "${raw4[@]}" )
|
base=( "${raw4[@]}" )
|
||||||
|
@ -1046,13 +1100,15 @@ fi_batt(){ # 06/03/2018
|
||||||
}
|
}
|
||||||
|
|
||||||
# [$1=silent], assigne $fe_nb_bluez, $fe_cards_bluez
|
# [$1=silent], assigne $fe_nb_bluez, $fe_cards_bluez
|
||||||
fi_bluez(){ # 06/03/2018
|
fi_bluez(){ # 16/06/2018
|
||||||
local bluez cmd_bluez cmt_bluez mod cmd_mod cmt_mod pluriel text
|
local bluez cmd_bluez cmt_bluez mod cmd_mod cmt_mod pluriel text
|
||||||
x_bluez=1
|
x_bluez=1
|
||||||
|
|
||||||
if type -p hcitool &>/dev/null ; then
|
if type -p hcitool &>/dev/null ; then
|
||||||
fe_nb_bluez=$( hcitool dev | grep -c 'hci[[:digit:]]' )
|
fe_nb_bluez=$( hcitool dev | grep -c 'hci[[:digit:]]' )
|
||||||
fe_cards_bluez=$( hcitool dev | grep -Eo 'hci[0-9]+' | tr '\n' ' ' )
|
fe_cards_bluez=$( hcitool dev | grep -Eo 'hci[0-9]+' )
|
||||||
|
fe_cards_bluez=${fe_cards_bluez//$'\n'/ }
|
||||||
|
fe_cards_bluez=${fe_cards_bluez%$'\n'}
|
||||||
else
|
else
|
||||||
fe_nb_bluez=-99
|
fe_nb_bluez=-99
|
||||||
fe_cards_bluez="n/a"
|
fe_cards_bluez="n/a"
|
||||||
|
@ -1252,29 +1308,26 @@ fi_disk(){ # 13/03/2018
|
||||||
f_dspl_alrt "$alert_uuidResume" "alert"
|
f_dspl_alrt "$alert_uuidResume" "alert"
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2181
|
fi_dmesg(){ # 16/06/2018
|
||||||
# SC2181 Check exit code directly
|
|
||||||
fi_dmesg(){ # 08/03/2018
|
|
||||||
local dmesg_err dmesg_warn dmesg_crit file info_ucode alert_firmBug text nb_lignes=25
|
local dmesg_err dmesg_warn dmesg_crit file info_ucode alert_firmBug text nb_lignes=25
|
||||||
local alert_firmBug
|
local alert_firmBug
|
||||||
|
|
||||||
file="/tmp/$script-dmesg"
|
file="/tmp/$script-dmesg"
|
||||||
[ "$EUID" -eq 0 ] || echo
|
[ "$EUID" -eq 0 ] || echo
|
||||||
f__sudo "dmesg -Hk --nopager -l emerg > $file-emerg ; \
|
if ! f__sudo "dmesg -Hk --nopager -l emerg > $file-emerg ; \
|
||||||
dmesg -Hk --nopager -l alert > $file-alert ; \
|
dmesg -Hk --nopager -l alert > $file-alert ; \
|
||||||
dmesg -Hk --nopager -l crit > $file-crit ; \
|
dmesg -Hk --nopager -l crit > $file-crit ; \
|
||||||
dmesg -Hk --nopager -l err > $file-err ; \
|
dmesg -Hk --nopager -l err > $file-err ; \
|
||||||
dmesg -Hk --nopager -l warn > $file-warn ; \
|
dmesg -Hk --nopager -l warn > $file-warn ; \
|
||||||
dmesg -Hk --nopager -l info | grep -i 'microcode: .*updated early' > $file-ucode ; \
|
dmesg -Hk --nopager -l info | grep -i 'microcode: .*updated early' > $file-ucode ; \
|
||||||
dmesg -Hk --nopager | grep -i 'Firmware Bug' > $file-firmBug ; \
|
dmesg -Hk --nopager | grep -i 'Firmware Bug' > $file-firmBug ; \
|
||||||
chown $fu_user: $file-*"
|
chown $fu_user: $file-*"; then
|
||||||
if [ "$?" != "0" ]; then
|
f__info "\n les commandes$GREEN dmesg$RED ont échoué $BLUE(droits root requis, échec authentification?)" \
|
||||||
f__info "\n les commandes$GREEN dmesg$RED ont échoué $BLUE(droits root requis, échec authentification?)" \
|
"vous pouvez relancer le script complet$RED en root$BLUE pour voir les erreurs du noyau via dmesg" \
|
||||||
"vous pouvez relancer le script complet$RED en root$BLUE pour voir les erreurs du noyau via dmesg" \
|
"ou juste la partie journaux avec $GREEN$DIRNAME""getInfo -j"
|
||||||
"ou juste la partie journaux avec $GREEN$DIRNAME""getInfo -j"
|
text+="* les commandes \`dmesg\` ont échoué, relancer avec les droits root \n\n"
|
||||||
text+="* les commandes \`dmesg\` ont échoué, relancer avec les droits root \n\n"
|
echo -e "$text" >> "$file_output"
|
||||||
echo -e "$text" >> "$file_output"
|
return 0
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
dmesg_emerg=$( sed -n 1,"$nb_lignes"p $file-emerg )
|
dmesg_emerg=$( sed -n 1,"$nb_lignes"p $file-emerg )
|
||||||
dmesg_alert=$( sed -n 1,"$nb_lignes"p $file-alert )
|
dmesg_alert=$( sed -n 1,"$nb_lignes"p $file-alert )
|
||||||
|
@ -1318,8 +1371,6 @@ fi_efi(){ # 06/03/2018
|
||||||
}
|
}
|
||||||
|
|
||||||
# [$1=silent|xorgOnly], assigne $fe_gpu (liste des gpu), $fe_nb_gpu, fe_Xorg (peut être null)
|
# [$1=silent|xorgOnly], assigne $fe_gpu (liste des gpu), $fe_nb_gpu, fe_Xorg (peut être null)
|
||||||
# shellcheck disable=SC2086
|
|
||||||
# SC2086 Double quote to prevent globbing and word splitting
|
|
||||||
fi_gpu(){ # 08/04/2018
|
fi_gpu(){ # 08/04/2018
|
||||||
local toScrut confs ifile fileConfs cmd_confs cmt_confs info_config
|
local toScrut confs ifile fileConfs cmd_confs cmt_confs info_config
|
||||||
local cards cmd_cards openGl pluriel text
|
local cards cmd_cards openGl pluriel text
|
||||||
|
@ -1528,9 +1579,7 @@ fi_ip_pub(){ # 16/06/2018 SPÉCIFIQUE
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2181
|
fi_journal(){ # 16/06/2018
|
||||||
# SC2181 Check exit code directly
|
|
||||||
fi_journal(){ # 06/03/2018
|
|
||||||
local file options_jctl jctl_boot jctl_alert_k jctl_crit_k jctl_err_k jctl_warn_k jctl_warn_nok jctl_last jctl_size
|
local file options_jctl jctl_boot jctl_alert_k jctl_crit_k jctl_err_k jctl_warn_k jctl_warn_nok jctl_last jctl_size
|
||||||
local info_ucode text nb_lignes=25
|
local info_ucode text nb_lignes=25
|
||||||
local alert_jctl_persist alert_firmBug
|
local alert_jctl_persist alert_firmBug
|
||||||
|
@ -1551,7 +1600,7 @@ fi_journal(){ # 06/03/2018
|
||||||
f__info "raw" "[sudo] nécessite le mot de passe utilisateur si celui peut obtenir les privilèges administrateur"
|
f__info "raw" "[sudo] nécessite le mot de passe utilisateur si celui peut obtenir les privilèges administrateur"
|
||||||
f__info "à défaut de saisie valide, les journaux n'apparaîtront pas dans le rapport final"
|
f__info "à défaut de saisie valide, les journaux n'apparaîtront pas dans le rapport final"
|
||||||
fi
|
fi
|
||||||
f__sudo "LC_ALL=C journalctl $options_jctl --boot -1 &>$file-persistant ; \
|
if ! f__sudo "LC_ALL=C journalctl $options_jctl --boot -1 &>$file-persistant ; \
|
||||||
LC_ALL=C journalctl --no-pager $options_jctl -b0 -k -p 1 > $file-alert ; \
|
LC_ALL=C journalctl --no-pager $options_jctl -b0 -k -p 1 > $file-alert ; \
|
||||||
LC_ALL=C journalctl --no-pager $options_jctl -b0 -k -p 2..2 > $file-crit ; \
|
LC_ALL=C journalctl --no-pager $options_jctl -b0 -k -p 2..2 > $file-crit ; \
|
||||||
LC_ALL=C journalctl --no-pager $options_jctl -b0 -p 3..3 > $file-err ; \
|
LC_ALL=C journalctl --no-pager $options_jctl -b0 -p 3..3 > $file-err ; \
|
||||||
|
@ -1560,14 +1609,13 @@ fi_journal(){ # 06/03/2018
|
||||||
LC_ALL=C journalctl --disk-usage > $file-size ; \
|
LC_ALL=C journalctl --disk-usage > $file-size ; \
|
||||||
LC_ALL=C journalctl --no-pager $options_jctl -o short-monotonic --boot 0 -k -p6 | grep -i 'microcode: .*updated early' > $file-ucode ; \
|
LC_ALL=C journalctl --no-pager $options_jctl -o short-monotonic --boot 0 -k -p6 | grep -i 'microcode: .*updated early' > $file-ucode ; \
|
||||||
type -p dmesg &>/dev/null && dmesg -Hk --nopager | grep -i 'Firmware Bug' > $file-firmBug ; \
|
type -p dmesg &>/dev/null && dmesg -Hk --nopager | grep -i 'Firmware Bug' > $file-firmBug ; \
|
||||||
chown $fu_user: $file-*"
|
chown $fu_user: $file-*"; then
|
||||||
if [ "$?" != "0" ]; then
|
f__info "\n les commandes$GREEN journalctl$RED ont échoué $BLUE(droits root requis, échec authentification?)" \
|
||||||
f__info "\n les commandes$GREEN journalctl$RED ont échoué $BLUE(droits root requis, échec authentification?)" \
|
"vous pouvez relancer le script complet$RED en root$BLUE pour voir les erreurs des journaux" \
|
||||||
"vous pouvez relancer le script complet$RED en root$BLUE pour voir les erreurs des journaux" \
|
"ou juste la partie journaux avec $GREEN$DIRNAME""getInfo -j"
|
||||||
"ou juste la partie journaux avec $GREEN$DIRNAME""getInfo -j"
|
text+="* les commandes \`journalctl\` ont échoué, relancer avec les droits root \n\n"
|
||||||
text+="* les commandes \`journalctl\` ont échoué, relancer avec les droits root \n\n"
|
echo -e "$text" >> "$file_output"
|
||||||
echo -e "$text" >> "$file_output"
|
return 0
|
||||||
return 0
|
|
||||||
fi
|
fi
|
||||||
# début des logs, extraction à partir de file-last (toujours lignes) pour début des logs
|
# début des logs, extraction à partir de file-last (toujours lignes) pour début des logs
|
||||||
jctl_boot=$( awk -F '--|,' 'FNR==1 {print $2}' $file-last )
|
jctl_boot=$( awk -F '--|,' 'FNR==1 {print $2}' $file-last )
|
||||||
|
@ -2456,9 +2504,7 @@ fi_ssid(){ # 06/03/2018
|
||||||
rm "$file_output"
|
rm "$file_output"
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2010
|
fi_system(){ # 16/06/2018
|
||||||
# SC2010 Don't use ls | grep. Use a glob ... to allow non-alphanumeric filenames.
|
|
||||||
fi_system(){ # 15/06/2018
|
|
||||||
local mbr uname bootImage initDaemon upstart date_install lastboot uptime uptimePure loadAverage pluriel text
|
local mbr uname bootImage initDaemon upstart date_install lastboot uptime uptimePure loadAverage pluriel text
|
||||||
local enum_batt nb_desktop serverX serverType
|
local enum_batt nb_desktop serverX serverType
|
||||||
local alimentation alim_total
|
local alimentation alim_total
|
||||||
|
@ -2566,7 +2612,7 @@ fi_system(){ # 15/06/2018
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# alimentation
|
# alimentation
|
||||||
if ls -1 "/sys/class/power_supply/" | grep -iq '^AC' ; then
|
if grep -iq '/AC' <<< "$( echo /sys/class/power_supply/* )" ; then
|
||||||
alim_total=$( grep -cs '1' /sys/class/power_supply/AC*/online )
|
alim_total=$( grep -cs '1' /sys/class/power_supply/AC*/online )
|
||||||
alimentation=$( awk -v "alim_total=$alim_total" '
|
alimentation=$( awk -v "alim_total=$alim_total" '
|
||||||
{ alim_on=sprintf("%d", $1); if (alim_on>1) pllo="s" }
|
{ alim_on=sprintf("%d", $1); if (alim_on>1) pllo="s" }
|
||||||
|
@ -2574,7 +2620,6 @@ fi_system(){ # 15/06/2018
|
||||||
if ( alim_total != alim_on ) print ", " alim_on " branchée" pllo; else print "" }
|
if ( alim_total != alim_on ) print ", " alim_on " branchée" pllo; else print "" }
|
||||||
' /sys/class/power_supply/AC*/online )
|
' /sys/class/power_supply/AC*/online )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# batterie(s)
|
# batterie(s)
|
||||||
enum_batt=$( grep -E '[A-Z][A-Z]' <<< "$fg_batt" )
|
enum_batt=$( grep -E '[A-Z][A-Z]' <<< "$fg_batt" )
|
||||||
###
|
###
|
||||||
|
@ -3831,9 +3876,7 @@ figet_dmi(){ # 06/03/2018
|
||||||
}
|
}
|
||||||
|
|
||||||
# infos température et fan via acpi, assigne $fg_hw
|
# infos température et fan via acpi, assigne $fg_hw
|
||||||
# shellcheck disable=SC2010
|
figet_hw(){ # 16/06/2018
|
||||||
# SC2010 Don't use ls | grep. Use a glob ... to allow non-alphanumeric filenames.
|
|
||||||
figet_hw(){ # 05/03/2018
|
|
||||||
local name labelF inputF labelT inputT critT hystT maxiT fan temp ihw
|
local name labelF inputF labelT inputT critT hystT maxiT fan temp ihw
|
||||||
x_hw=1
|
x_hw=1
|
||||||
|
|
||||||
|
@ -3842,11 +3885,11 @@ figet_hw(){ # 05/03/2018
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
for ihw in /sys/class/hwmon/* ; do
|
for ihw in /sys/class/hwmon/* ; do
|
||||||
ihw=${ihw%\*} # fix à la rache, quand /sys/class/hwmon/* est vide, le développement du chemin ne se fait pas (vbox), reste * finale, et erreur sir ls suivants
|
ihw=${ihw%\*} # fix à la rache, quand /sys/class/hwmon/* est vide, le développement du chemin ne se fait pas (vbox), reste * finale, et erreur sur ls suivants
|
||||||
name=$( cat "$ihw/name" 2>/dev/null )
|
name=$( cat "$ihw/name" 2>/dev/null )
|
||||||
name=${name:-indéfini} # indéfini si null
|
name=${name:-indéfini} # indéfini si null
|
||||||
## TEMPÉRATURE
|
## TEMPÉRATURE
|
||||||
if ls "$ihw" | grep -Eq 'temp[0-9]+' ; then # tempX dans un nom de fichier
|
if grep -Eq 'temp[0-9]+' <<< "$( ls "$ihw" )" ; then # tempX dans un nom de fichier
|
||||||
# extraction label
|
# extraction label
|
||||||
labelT=$( cat "$ihw"/temp*_label 2>/dev/null | tr ' ' '-' | tr '\n' '/' )
|
labelT=$( cat "$ihw"/temp*_label 2>/dev/null | tr ' ' '-' | tr '\n' '/' )
|
||||||
# extraction températures
|
# extraction températures
|
||||||
|
@ -3878,7 +3921,7 @@ figet_hw(){ # 05/03/2018
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
## FAN
|
## FAN
|
||||||
if ls "$ihw" | grep -Eq 'fan[0-9]+' ; then # fanX dans un nom de fichier
|
if grep -Eq 'fan[0-9]+' <<< "$( ls "$ihw" )" ; then # fanX dans un nom de fichier
|
||||||
# extraction label (si existe?)
|
# extraction label (si existe?)
|
||||||
labelF=$( cat "$ihw"/fan*_label 2>/dev/null | tr ' ' '-' | tr '\n' '/' )
|
labelF=$( cat "$ihw"/fan*_label 2>/dev/null | tr ' ' '-' | tr '\n' '/' )
|
||||||
# extraction vitesse fan
|
# extraction vitesse fan
|
||||||
|
@ -3960,9 +4003,7 @@ figet_ip(){ # 06/03/2018
|
||||||
# $2=name: device(s) (name) -> assigne ${lspci[name]} ${lspci[nb_card]}
|
# $2=name: device(s) (name) -> assigne ${lspci[name]} ${lspci[nb_card]}
|
||||||
# $2=raw: détail lspci (-nnv) -> assigne ${lspci[card]} [${lspci[prefix_gpu]}]
|
# $2=raw: détail lspci (-nnv) -> assigne ${lspci[card]} [${lspci[prefix_gpu]}]
|
||||||
# $2=module: (module kernel) -> assigne ${lspci[module]} ${lspci[srch_mod]} ${lspci[card]} [${lspci[prefix_gpu]}]
|
# $2=module: (module kernel) -> assigne ${lspci[module]} ${lspci[srch_mod]} ${lspci[card]} [${lspci[prefix_gpu]}]
|
||||||
# shellcheck disable=SC2034
|
figet_lspci(){ # 16/06/2018
|
||||||
# SC2034 foo appears unused. Verify it or export it.
|
|
||||||
figet_lspci(){ # 07/03/2018
|
|
||||||
local motif field1 pci slots nb_slots pci modLspci mod_file
|
local motif field1 pci slots nb_slots pci modLspci mod_file
|
||||||
|
|
||||||
if [ "$1" = "audio" ]; then
|
if [ "$1" = "audio" ]; then
|
||||||
|
@ -3980,6 +4021,7 @@ figet_lspci(){ # 07/03/2018
|
||||||
# les devices
|
# les devices
|
||||||
if [ "$2" == "name" ]; then
|
if [ "$2" == "name" ]; then
|
||||||
unset 'lspci[name]'
|
unset 'lspci[name]'
|
||||||
|
# shellcheck disable=SC2034
|
||||||
while read -r field1 pci; do
|
while read -r field1 pci; do
|
||||||
pci=${pci%(rev *)}
|
pci=${pci%(rev *)}
|
||||||
lspci[name]+="$pci "$'\n'
|
lspci[name]+="$pci "$'\n'
|
||||||
|
@ -4042,12 +4084,11 @@ figet_lspci(){ # 07/03/2018
|
||||||
|
|
||||||
# $1=mem|swap [total|notitle|nocoltitle], assigne $fg_mem
|
# $1=mem|swap [total|notitle|nocoltitle], assigne $fg_mem
|
||||||
# indépendant de procps, affichage plus clair que free, mais résultats identiques
|
# indépendant de procps, affichage plus clair que free, mais résultats identiques
|
||||||
# shellcheck disable=SC2034
|
figet_mem(){ # 16/06/2018
|
||||||
# SC2034 foo appears unused. Verify it or export it.
|
|
||||||
figet_mem(){ # 06/03/2018
|
|
||||||
local MemTotal MemFree MemAvailable Buffers Cached SReclaimable Shmem MemUsed
|
local MemTotal MemFree MemAvailable Buffers Cached SReclaimable Shmem MemUsed
|
||||||
local SwapTotal SwapFree SwapCached col a b c MemLibre
|
local SwapTotal SwapFree SwapCached col a b c MemLibre
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034
|
||||||
while read -r a b c; do
|
while read -r a b c; do
|
||||||
[ "$a" == "MemTotal:" ] && MemTotal="$b" #echo "$a $(( ${b/kB}/1024 ))" ! partie entière !
|
[ "$a" == "MemTotal:" ] && MemTotal="$b" #echo "$a $(( ${b/kB}/1024 ))" ! partie entière !
|
||||||
[ "$a" == "MemAvailable:" ] && MemAvailable="$b"
|
[ "$a" == "MemAvailable:" ] && MemAvailable="$b"
|
||||||
|
@ -4715,14 +4756,14 @@ prg_init(){ # 08/04/2018
|
||||||
# définition couleurs
|
# définition couleurs
|
||||||
f__color
|
f__color
|
||||||
}
|
}
|
||||||
prg_1(){ # 02/12/2017 début
|
prg_1(){ # 16/06/2018d début
|
||||||
|
|
||||||
echo > "$file_output"
|
echo > "$file_output"
|
||||||
chown $fu_user: "$file_output" &>/dev/null
|
chown $fu_user: "$file_output" &>/dev/null
|
||||||
chmod 666 "$file_output" &>/dev/null # rw-rw-rw-, si root permet écriture & effacement à tous
|
chmod 666 "$file_output" &>/dev/null # rw-rw-rw-, si root permet écriture & effacement à tous
|
||||||
echo -e "* **$script** sur *$(uname -n)* \n" > "$file_output"
|
echo -e "* **$script** sur *$( uname -n )* \\n" > "$file_output"
|
||||||
echo -e "$ligneRapport \n" >> "$file_output"
|
echo -e "$ligneRapport \\n" >> "$file_output"
|
||||||
echo -e "--- \n" >> "$file_output"
|
echo -e "--- \\n" >> "$file_output"
|
||||||
}
|
}
|
||||||
prg_2(){ # 08/03/2018 traitements principaux
|
prg_2(){ # 08/03/2018 traitements principaux
|
||||||
|
|
||||||
|
@ -4817,14 +4858,11 @@ function prg_menu_display { # 06/03/2018
|
||||||
# tests au démarrage
|
# tests au démarrage
|
||||||
prg_init
|
prg_init
|
||||||
|
|
||||||
# logo et définition couleurs
|
|
||||||
[ "$1" != "--rc" ] && f_affichage
|
|
||||||
|
|
||||||
# paramètres script
|
# paramètres script
|
||||||
user_agent="Mozilla/5.0 Firefox"
|
user_agent="Mozilla/5.0 Firefox"
|
||||||
fileDev="/opt/bin/fileDev"
|
fileDev="/opt/bin/fileDev"
|
||||||
file_output="getInfo_rapport.md"
|
file_output="getInfo_rapport.md"
|
||||||
debug_output="/tmp/$script.log"
|
debug_output="$script.log"
|
||||||
script_install="/opt/bin/$script"
|
script_install="/opt/bin/$script"
|
||||||
script_logs="/var/log/sdeb_$script.log"
|
script_logs="/var/log/sdeb_$script.log"
|
||||||
url_script="https://framagit.org/sdeb/getInfo/raw/master/getInfo"
|
url_script="https://framagit.org/sdeb/getInfo/raw/master/getInfo"
|
||||||
|
@ -4835,94 +4873,82 @@ spc5=$'\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0'
|
||||||
ligneRapport="Rapport du $(date '+%d/%m/%Y %H:%M %z')$spc5◇$spc5$0 $*$spc5◇${spc5}[$script $version]($url_notice)"
|
ligneRapport="Rapport du $(date '+%d/%m/%Y %H:%M %z')$spc5◇$spc5$0 $*$spc5◇${spc5}[$script $version]($url_notice)"
|
||||||
|
|
||||||
declare -A lspci # sortie figet_lspci
|
declare -A lspci # sortie figet_lspci
|
||||||
|
script_options="$*"
|
||||||
|
# logo
|
||||||
|
[ "$1" != "--rc" ] && f_affichage
|
||||||
|
|
||||||
options="$*"
|
# options
|
||||||
|
while (( $# )) ; do
|
||||||
for j in $options; do # première passe options
|
case "$1" in
|
||||||
case $j in
|
-c ) options+=( "menu" ) ;;
|
||||||
|
-c* ) categorie+=${1#-c} ;;
|
||||||
--debug-paste ) # si debug, retour json de pastery.net
|
--debug-paste ) # si debug, retour json de pastery.net
|
||||||
optDebug="debugPaste"
|
optDebug="debugPaste" ;;
|
||||||
;;
|
|
||||||
--debug ) # enregistrement stderr dans $script.log
|
--debug ) # enregistrement stderr dans $script.log
|
||||||
debugScript="ok"
|
debugScript="ok"
|
||||||
echo > "$debug_output"
|
echo > "$debug_output"
|
||||||
chmod 666 "$debug_output" &>/dev/null
|
chmod 666 "$debug_output" &>/dev/null
|
||||||
exec 4>&2 # sauvegarde
|
exec 4>&2 # sauvegarde
|
||||||
exec 2> "$debug_output" # redirection
|
exec 2> "$debug_output" # redirection
|
||||||
echo -e "$ligneRapport \n" 1>&2
|
echo -e "$ligneRapport \\n" 1>&2 ;;
|
||||||
;;
|
--dev ) url_script=${url_script//\/master\///dev/} ;;
|
||||||
|
-t ) options+=( "$1" ) ;;
|
||||||
-t* ) # durée de conservation standard du paste en jours
|
-t* ) # durée de conservation standard du paste en jours
|
||||||
pasteDuration=$(( $( sed -En 's/-t([0-9]+)/\1/p' <<< "$j" ) ))
|
pasteDuration=$(( ${1#-t} ))
|
||||||
;;
|
(( pasteDuration == 0 )) && pasteDuration=1 ;;
|
||||||
-i | --install | -r | --remove | --irc | --rrc ) # root requis si install ou remove script
|
* ) options+=( "$1" ) ;;
|
||||||
if [ "$EUID" -ne 0 ]; then
|
|
||||||
f__info "vous devez être$RED ROOT$BLUE pour cette opération"
|
|
||||||
f__sudo "exec $0 $*"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
;;&
|
|
||||||
esac
|
esac
|
||||||
|
shift
|
||||||
done
|
done
|
||||||
options=$( sed -E 's/--debug-paste//g; s/-t[0-9]+//g; s/--debug//g' <<< "$options" | xargs ) # nettoyage options
|
[ "$categorie" ] && options+=( -c"$categorie" )
|
||||||
|
(( ${#options[@]} == 0 )) && options=( all )
|
||||||
|
|
||||||
[ "$options" ] || options="all"
|
#actions
|
||||||
|
for i in "${!options[@]}"; do
|
||||||
|
# shellcheck disable=SC2221,SC2222
|
||||||
|
case ${options[$i]} in
|
||||||
|
-i | --install | -r | --remove | --irc | --rrc )
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
f__info raw "vous devez être$RED ROOT$BLUE pour cette opération"
|
||||||
|
f__sudo "exec $0 $script_options"
|
||||||
|
exit
|
||||||
|
fi ;;&
|
||||||
|
|
||||||
|
|
||||||
for k in $options; do # traitement options menu catégories
|
|
||||||
categorie+=$( sed -En 's/-c([a-z]+)/\1/p' <<< "$k" )
|
|
||||||
options=$( sed -E 's/-c[a-z]+//' <<< "$k" | xargs )
|
|
||||||
done
|
|
||||||
[ "$categorie" ] && options+=" -c$categorie"
|
|
||||||
|
|
||||||
for j in $options; do # deuxième passe options, actions
|
|
||||||
case $j in
|
|
||||||
-t | --test ) # test
|
-t | --test ) # test
|
||||||
ORIGIN='test'
|
ORIGIN='test'
|
||||||
prg_1 "$*"
|
prg_1
|
||||||
echo -n "•"
|
|
||||||
# fi_system fi_cpu fi_mem fi_hw fi_batt fi_gpu fi_net fi_audio fi_touchpad fi_bluez fi_usb fi_disk
|
# fi_system fi_cpu fi_mem fi_hw fi_batt fi_gpu fi_net fi_audio fi_touchpad fi_bluez fi_usb fi_disk
|
||||||
# fi_efi fi_locale fi_conf fi_vrms fi_packagers
|
# fi_efi fi_locale fi_conf fi_vrms fi_packagers
|
||||||
# fi_reseau fi_nm
|
# fi_reseau fi_nm
|
||||||
# fi_system_analyse fi_journal_xorg fi_journal
|
# fi_system_analyse fi_journal_xorg fi_journal
|
||||||
fi_system
|
fi_system
|
||||||
echo
|
echo
|
||||||
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi
|
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi ;;
|
||||||
;;
|
-c ) exec "$0" "menu" ;; # menu catégorie
|
||||||
-c* | all ) # rapport complet ou par catégorie
|
-c* | all ) # rapport complet ou par catégorie
|
||||||
[ "$j" == "-c" ] && exec "$0" "menu"
|
prg_1
|
||||||
prg_1 "$*"
|
prg_2 "${options[$i]#-c}"
|
||||||
j=$( sed -E 's/-c//' <<< "$j" )
|
prg_3 ;;
|
||||||
prg_2 "$j"
|
|
||||||
prg_3
|
|
||||||
;;
|
|
||||||
-dx ) # essai détail, xorgOnly
|
-dx ) # essai détail, xorgOnly
|
||||||
prg_1 "$*"
|
prg_1
|
||||||
fi_gpu "xorgOnly"
|
fi_gpu "xorgOnly"
|
||||||
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi
|
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi ;;
|
||||||
exit ;;
|
|
||||||
-dp ) # essai util source/apt confOnly
|
-dp ) # essai util source/apt confOnly
|
||||||
prg_1 "$*"
|
prg_1
|
||||||
fi_pkg_apt "confOnly"
|
fi_pkg_apt "confOnly"
|
||||||
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi
|
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi ;;
|
||||||
;;
|
|
||||||
-j ) # analyse, catégorie -ca
|
-j ) # analyse, catégorie -ca
|
||||||
prg_1 "$*"
|
prg_1
|
||||||
prg_2 "a"
|
prg_2 "a" ;;
|
||||||
;;
|
|
||||||
-l ) # afficher le rapport existant
|
-l ) # afficher le rapport existant
|
||||||
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi
|
if [ "$DISPLAY" ]; then f_prnt_md "$file_output"; else pager "$file_output"; fi ;;
|
||||||
;;
|
|
||||||
-p ) # exporte le rapport existant
|
-p ) # exporte le rapport existant
|
||||||
fipaste
|
fipaste ;;
|
||||||
;;
|
|
||||||
--ip ) # affiche ip public (ipv4&6)
|
--ip ) # affiche ip public (ipv4&6)
|
||||||
fi_ip_pub
|
fi_ip_pub ; echo ;;
|
||||||
echo
|
|
||||||
;;
|
|
||||||
--mac ) # affiche adresses mac
|
--mac ) # affiche adresses mac
|
||||||
figet_ip
|
figet_ip
|
||||||
f__info "adresses MAC:\n$STD$BOLD$fg_mac"
|
f__info "adresses MAC:\n$STD$BOLD$fg_mac" ;;
|
||||||
;;
|
|
||||||
--rc ) # gfetch
|
--rc ) # gfetch
|
||||||
operation="rc"
|
operation="rc"
|
||||||
file_output="/tmp/getInfo.rc"
|
file_output="/tmp/getInfo.rc"
|
||||||
|
@ -4932,26 +4958,20 @@ for j in $options; do # deuxième passe options, actions
|
||||||
f_prnt_md "$file_output"
|
f_prnt_md "$file_output"
|
||||||
exit ;;
|
exit ;;
|
||||||
--serial ) # affiche n° série
|
--serial ) # affiche n° série
|
||||||
fi_serial
|
fi_serial ;;
|
||||||
;;
|
|
||||||
--ssid ) # affiche configurations ssid
|
--ssid ) # affiche configurations ssid
|
||||||
fi_ssid
|
fi_ssid ;;
|
||||||
;;
|
|
||||||
-h ) # affichage help
|
-h ) # affichage help
|
||||||
f_help
|
f_help ;;
|
||||||
;;
|
|
||||||
-i | --install ) # installation script
|
-i | --install ) # installation script
|
||||||
fscript_install
|
fscript_install ;;
|
||||||
;;
|
|
||||||
-r | --remove ) # remove script
|
-r | --remove ) # remove script
|
||||||
fscript_remove
|
fscript_remove ;;
|
||||||
;;
|
|
||||||
--irc ) # install gfetch only
|
--irc ) # install gfetch only
|
||||||
fscript_install_special
|
fscript_install_special ;;
|
||||||
;;
|
|
||||||
--rrc ) # remove gfetch only
|
--rrc ) # remove gfetch only
|
||||||
fscript_remove_special
|
fscript_remove_special ;;
|
||||||
;;
|
|
||||||
-u | --upgrade ) # upgrade script
|
-u | --upgrade ) # upgrade script
|
||||||
operation="upgrade" # log si f__error
|
operation="upgrade" # log si f__error
|
||||||
fscript_update std # std argument obligatoire pour upgrade normal
|
fscript_update std # std argument obligatoire pour upgrade normal
|
||||||
|
@ -4962,9 +4982,9 @@ for j in $options; do # deuxième passe options, actions
|
||||||
fscript_update "update en place" # redéfinition répertoire install avec celui du script
|
fscript_update "update en place" # redéfinition répertoire install avec celui du script
|
||||||
exit ;;
|
exit ;;
|
||||||
-v | --version ) # version du script, en ligne et en place
|
-v | --version ) # version du script, en ligne et en place
|
||||||
fscript_get_version
|
fscript_get_version ;;
|
||||||
;;
|
|
||||||
menu | * ) # affichage help
|
menu | * ) # affichage menu catégorie
|
||||||
prg_1 "$*"
|
prg_1 "$*"
|
||||||
prg_menu
|
prg_menu
|
||||||
exit ;;
|
exit ;;
|
||||||
|
@ -4980,3 +5000,4 @@ curl -L -o getInfo https://framaclic.org/h/getinfo
|
||||||
chmod +x getInfo && ./getInfo
|
chmod +x getInfo && ./getInfo
|
||||||
|
|
||||||
wget -nv -O getInfo https://framagit.org/sdeb/getInfo/raw/master/getInfo
|
wget -nv -O getInfo https://framagit.org/sdeb/getInfo/raw/master/getInfo
|
||||||
|
curl -OL https://framagit.org/sdeb/getInfo/raw/master/getInfo
|
||||||
|
|
136
scripts/getIp
136
scripts/getIp
|
@ -1,10 +1,9 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# shellcheck disable=SC2016,SC1117
|
# shellcheck disable=SC2016
|
||||||
|
|
||||||
# SC2016 Expressions don't expand in single quotes
|
# SC2016 Expressions don't expand in single quotes
|
||||||
# SC1117: Backslash is literal in "\n". Prefer explicit escaping: "\\n".
|
|
||||||
|
|
||||||
version=2.13.0
|
version=2.14.2
|
||||||
date="16/06/2018"
|
date="16/06/2018"
|
||||||
script="getIp"
|
script="getIp"
|
||||||
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getIp/issues"
|
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getIp/issues"
|
||||||
|
@ -81,6 +80,59 @@ f__color(){ # 29/05/2018
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# use dig or drill according to availability, options: hostname [@server|type|nostd|host], display ip | n/a (equivalent + short)
|
||||||
|
# if option --host, diplay hostname: ip
|
||||||
|
# dig has priority over dril if the two command are presents
|
||||||
|
# type : aaaa | a | txt | soa | any | mx | AAAA | A | TXT | SOA | ANY | MX
|
||||||
|
# option nostd for dig only: +timeout=1 +retry=1
|
||||||
|
f__dig(){ # 16/06/2018
|
||||||
|
local ini options type host server hostname dig ip domain ttl class typ ipx z
|
||||||
|
|
||||||
|
ini=$( shopt -p nocasematch )
|
||||||
|
if (( $# == 0 )); then
|
||||||
|
echo "f__dig: argument manquant"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
shopt -s nocasematch
|
||||||
|
while (( $# )) ; do
|
||||||
|
case "$1" in
|
||||||
|
nostd ) options+=( '+timeout=1' '+retry=1' ) ;;
|
||||||
|
aaaa | a | txt | soa | any | mx ) type="$1" ;;
|
||||||
|
host ) host='yes' ;;
|
||||||
|
@* ) server=( "$1" ) ;;
|
||||||
|
* ) hostname="$1" ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
type="${type:=A}"
|
||||||
|
if type -p dig &>/dev/null; then
|
||||||
|
dig=$( dig "${options[@]}" "$hostname" "${server[@]}" "$type" )
|
||||||
|
elif type -p drill &>/dev/null; then
|
||||||
|
dig=$( drill "$hostname" "${server[@]}" "${type[@]}" )
|
||||||
|
else
|
||||||
|
echo "dig or drill command unavailable"
|
||||||
|
eval "$ini"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
if [[ $dig =~ answer:\ 0 ]]; then
|
||||||
|
dig='n/a'
|
||||||
|
elif [[ $dig =~ answer:\ 1 ]]; then
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
while read -r domain ttl class typ ipx z; do
|
||||||
|
if [[ $domain$class$typ == ${hostname}\.IN$type ]]; then
|
||||||
|
ip+="$ipx "
|
||||||
|
fi
|
||||||
|
done <<< "$dig"
|
||||||
|
dig="$ip"
|
||||||
|
fi
|
||||||
|
[ "$host" ] && echo -n "$hostname: "
|
||||||
|
echo "$dig"
|
||||||
|
eval "$ini"
|
||||||
|
if [ "$dig" == "n/a" ]; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# $1=-c|-l|-lc, $2 répertoire, [$3] motif exclusion sur nom fichier, affiche 0|null si répertoire inexistant
|
# $1=-c|-l|-lc, $2 répertoire, [$3] motif exclusion sur nom fichier, affiche 0|null si répertoire inexistant
|
||||||
# -c: compte du nombre de fichiers dans un répertoire
|
# -c: compte du nombre de fichiers dans un répertoire
|
||||||
# -l: liste inline des noms de fichiers seuls (sans chemin) (similaire ls)
|
# -l: liste inline des noms de fichiers seuls (sans chemin) (similaire ls)
|
||||||
|
@ -228,6 +280,15 @@ f__sudo(){ # 11/06/2018
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# $1=NOM de la variable à trimer (variable et non $variable), [$2=left|right|all], all si vide
|
||||||
|
f__trim(){ # 07/03/2018
|
||||||
|
local trim=${!1}
|
||||||
|
|
||||||
|
[[ "$2" == right || "$2" == all || -z "$2" ]] && trim="${trim%${trim##*[^[:space:]]}}" # fin right
|
||||||
|
[[ "$2" == left || "$2" == all || -z "$2" ]] && trim="${trim#${trim%%[^[:space:]]*}}" # début left
|
||||||
|
eval "$1=\"$trim\""
|
||||||
|
}
|
||||||
|
|
||||||
# user ayant initié la session graphique, assigne $fu_user
|
# user ayant initié la session graphique, assigne $fu_user
|
||||||
# return 1 sur échec identification user, return 2 sur absence home/
|
# return 1 sur échec identification user, return 2 sur absence home/
|
||||||
# gestion variable environnement user avec: USER_INSTALL=<user> script
|
# gestion variable environnement user avec: USER_INSTALL=<user> script
|
||||||
|
@ -343,7 +404,8 @@ f__wget_test(){ # 07/06/2018
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
f_affichage(){ # 15/06/2018
|
# shellcheck disable=SC1117
|
||||||
|
f_affichage(){ # 16/06/2018
|
||||||
(( x_logo == 1 )) && return
|
(( x_logo == 1 )) && return
|
||||||
x_logo=1
|
x_logo=1
|
||||||
clear 2>/dev/null || tput clear 2>/dev/null
|
clear 2>/dev/null || tput clear 2>/dev/null
|
||||||
|
@ -363,7 +425,7 @@ f_affichage(){ # 15/06/2018
|
||||||
echo -e "$date$STD\n"
|
echo -e "$date$STD\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
f_help(){ # 15/06/2018
|
f_help(){ # 16/06/2018
|
||||||
cat <<- end
|
cat <<- end
|
||||||
|
|
||||||
${GREEN}./getIp :$STD exécution script
|
${GREEN}./getIp :$STD exécution script
|
||||||
|
@ -377,12 +439,14 @@ f_help(){ # 15/06/2018
|
||||||
$BLUE$script -46$STD --public : affiche ipv4 & ipv6 public
|
$BLUE$script -46$STD --public : affiche ipv4 & ipv6 public
|
||||||
$BLUE$script ''$STD, --local : affiche adresses mac / ip privées / passerelle
|
$BLUE$script ''$STD, --local : affiche adresses mac / ip privées / passerelle
|
||||||
$BLUE$script -us$STD : upgrade spécial du script en place (sans être installé)
|
$BLUE$script -us$STD : upgrade spécial du script en place (sans être installé)
|
||||||
|
|
||||||
|
$GREEN --dev :$STD une version de dev du script (si existante) est recherchée
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
$BLUE./$script -i$STD : installation du script dans le système $RED(root)$STD
|
$BLUE./$script -i$STD : installation du script dans le système $RED(root)$STD
|
||||||
$BLUE$script -h$STD, --help : affichage aide
|
$BLUE$script -h$STD, --help : affichage aide
|
||||||
$BLUE$script -r$STD, --remove : désinstallation du script $RED(root)$STD
|
$BLUE$script -r$STD, --remove : désinstallation du script $RED(root)$STD
|
||||||
$BLUE$script -u$STD, --upgrade : mise à jour script
|
$BLUE$script -u$STD, --upgrade : mise à jour script
|
||||||
$BLUE$script -v$STD, --version : version du script
|
$BLUE$script -v$STD, --version : version du script, installée et en ligne
|
||||||
-----------------------------------------------------------------------
|
-----------------------------------------------------------------------
|
||||||
plus d'infos: $GREEN$url_notice$STD
|
plus d'infos: $GREEN$url_notice$STD
|
||||||
|
|
||||||
|
@ -391,8 +455,8 @@ f_help(){ # 15/06/2018
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1 [-4|-6], par défaut -4, affiche ip pub, return 1 on failure
|
# $1 [-4|-6], par défaut -4, affiche ip pub, return 1 on failure
|
||||||
# requiert f__cnx & f_ip_validate & f__random & f__log
|
# requiert f__cnx & f_ip_validate & f__random & f__log & f__dig
|
||||||
f_ip_pub(){ # 16/06/2018
|
f_ip_pub(){ # 16/06/2018-2
|
||||||
local proto="-4" ip_pub base_size cmd sequence xyz server user_agent="Mozilla/5.0 Firefox"
|
local proto="-4" ip_pub base_size cmd sequence xyz server user_agent="Mozilla/5.0 Firefox"
|
||||||
declare -a base cmds raw4 raw6 dns4 dns6
|
declare -a base cmds raw4 raw6 dns4 dns6
|
||||||
|
|
||||||
|
@ -447,18 +511,18 @@ f_ip_pub(){ # 16/06/2018
|
||||||
[[ "$1" == '-6' || "$1" == '6' ]] && proto="-6"
|
[[ "$1" == '-6' || "$1" == '6' ]] && proto="-6"
|
||||||
|
|
||||||
type -p host &>/dev/null && cmds+=( "host -R0 -W1 -t " ) # deprecated
|
type -p host &>/dev/null && cmds+=( "host -R0 -W1 -t " ) # deprecated
|
||||||
type -p dig &>/dev/null && cmds+=( "dig +short +timeout=1 +retry=1 " )
|
type -p dig &>/dev/null || type -p drill &>/dev/null && cmds+=( "f__dig nostd " )
|
||||||
type -p wget &>/dev/null && cmds+=( "wget --user-agent=$user_agent --quiet --timeout=1 --tries=1 -o /dev/null -O - " )
|
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 curl &>/dev/null && cmds+=( "curl --silent --location --retry 0 --max-time 1 " )
|
||||||
if (( ${#cmds[@]} == 0 )); then
|
if (( ${#cmds[@]} == 0 )); then
|
||||||
echo "f_ip_pub(): no available commands (host|dig|wget|curl)" >&2
|
echo "f_ip_pub(): no available commands (host|dig|drill|wget|curl)" >&2
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for cmd in "${cmds[@]}"; do
|
for cmd in "${cmds[@]}"; do
|
||||||
if [[ "$proto" == '-4' && "$cmd" =~ ^(host|dig) ]] ; then
|
if [[ "$proto" == '-4' && "$cmd" =~ ^(host|f__dig) ]] ; then
|
||||||
base=( "${dns4[@]}" )
|
base=( "${dns4[@]}" )
|
||||||
elif [[ "$proto" == '-6' && "$cmd" =~ ^(host|dig) ]] ; then
|
elif [[ "$proto" == '-6' && "$cmd" =~ ^(host|f__dig) ]] ; then
|
||||||
base=( "${dns6[@]}" )
|
base=( "${dns6[@]}" )
|
||||||
elif [[ "$proto" == '-4' && "$cmd" =~ ^(wget|curl) ]] ; then
|
elif [[ "$proto" == '-4' && "$cmd" =~ ^(wget|curl) ]] ; then
|
||||||
base=( "${raw4[@]}" )
|
base=( "${raw4[@]}" )
|
||||||
|
@ -528,8 +592,8 @@ f_ip_validate(){ # 17/05/2018
|
||||||
# "[ \"$1\" != \"notitre\" ]" ou "[ $1 != notitre ]" (attention au manque de ")
|
# "[ \"$1\" != \"notitre\" ]" ou "[ $1 != notitre ]" (attention au manque de ")
|
||||||
# flush (f_pr flush) inutile si f_d(x) final
|
# flush (f_pr flush) inutile si f_d(x) final
|
||||||
# $1 type, $2 texte, [$3] test /!\ assigne la variable parent $text
|
# $1 type, $2 texte, [$3] test /!\ assigne la variable parent $text
|
||||||
f_pr(){ # 09/03/2018
|
f_pr(){ # 16/06/2018
|
||||||
local preline='' line='' endline=" \n"
|
local preline='' line='' endline=" \\n"
|
||||||
|
|
||||||
[[ "$1" == 'titre1' ]] && preline=" $GREEN"
|
[[ "$1" == 'titre1' ]] && preline=" $GREEN"
|
||||||
[[ "$1" == 'titre1' ]] && endline+="$STD"
|
[[ "$1" == 'titre1' ]] && endline+="$STD"
|
||||||
|
@ -544,16 +608,16 @@ f_pr(){ # 09/03/2018
|
||||||
eval "$3" || return 0 # évaluation de la CONDITION, si erreur: sortie
|
eval "$3" || return 0 # évaluation de la CONDITION, si erreur: sortie
|
||||||
fi
|
fi
|
||||||
if [[ "$1" == "hl" ]]; then # <hl>
|
if [[ "$1" == "hl" ]]; then # <hl>
|
||||||
text+="\n---\n\n"
|
text+="\\n---\\n\\n"
|
||||||
elif [[ "$1" ]]; then
|
elif [[ "$1" ]]; then
|
||||||
text+="$preline$line$endline" # ligne formatée
|
text+="$preline$line$endline" # ligne formatée
|
||||||
else
|
else
|
||||||
text+="\n" # newline
|
text+="\\n" # newline
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# affichage ip, local
|
# affichage ip, local
|
||||||
fi_ip(){ # 09/03/2018
|
fi_ip(){ # 16/06/2018
|
||||||
local ifn_p4 text
|
local ifn_p4 text
|
||||||
|
|
||||||
figet_ip "-4" || f__error "iproute2 doit être installé" "il remplace net-tools qui n'est plus développé"
|
figet_ip "-4" || f__error "iproute2 doit être installé" "il remplace net-tools qui n'est plus développé"
|
||||||
|
@ -584,7 +648,7 @@ fi_ip(){ # 09/03/2018
|
||||||
f_pr l2 "$fg_ip_deprec" '[ "$fg_ip_deprec" ]'
|
f_pr l2 "$fg_ip_deprec" '[ "$fg_ip_deprec" ]'
|
||||||
f_pr '[ "$fg_ip_deprec" ]'
|
f_pr '[ "$fg_ip_deprec" ]'
|
||||||
|
|
||||||
echo -en "$text\n" #>> "$fileOutput"
|
echo -en "$text\\n" #>> "$fileOutput"
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1=-4|-6|-46 protocole, affichage ip publiques
|
# $1=-4|-6|-46 protocole, affichage ip publiques
|
||||||
|
@ -816,7 +880,7 @@ test_user(){ # 09/03/2018
|
||||||
f__user
|
f__user
|
||||||
retourFUser="$?"
|
retourFUser="$?"
|
||||||
[ "$retourFUser" -eq 1 ] && f__error "user indéterminé" \
|
[ "$retourFUser" -eq 1 ] && f__error "user indéterminé" \
|
||||||
"pour contourner, lancer le script avec:\n$GREEN USER_INSTALL=<user> $0 \n"
|
"pour contourner, lancer le script avec:\\n$GREEN USER_INSTALL=<user> $0 \\n"
|
||||||
if [ "$retourFUser" -eq 2 ]; then
|
if [ "$retourFUser" -eq 2 ]; then
|
||||||
if [ "$EUID" -eq 0 ]; then
|
if [ "$EUID" -eq 0 ]; then
|
||||||
fu_user="root"
|
fu_user="root"
|
||||||
|
@ -861,24 +925,33 @@ script_logs="/var/log/sdeb_$script.log"
|
||||||
url_script="https://framagit.org/sdeb/getIp/raw/master/getIp"
|
url_script="https://framagit.org/sdeb/getIp/raw/master/getIp"
|
||||||
url_notice="https://framaclic.org/h/doc-getip"
|
url_notice="https://framaclic.org/h/doc-getip"
|
||||||
|
|
||||||
options="$*"
|
script_options="$*"
|
||||||
[ "$options" ] || options="--local"
|
# options
|
||||||
|
while (( $# )) ; do
|
||||||
|
case "$1" in
|
||||||
|
--dev ) url_script=${url_script//\/master\///dev/} ;;
|
||||||
|
* ) options+=( "$1" ) ;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
(( ${#options[@]} == 0 )) && options=( --local ) # vide help (si fileDev), sinon install
|
||||||
|
|
||||||
for j in $options; do
|
#actions
|
||||||
|
for i in "${!options[@]}"; do
|
||||||
# shellcheck disable=SC2221,SC2222
|
# shellcheck disable=SC2221,SC2222
|
||||||
case $j in
|
case ${options[$i]} in
|
||||||
|
-i | --install | -r | --remove )
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
f__info raw "vous devez être$RED ROOT$BLUE pour cette opération"
|
||||||
|
f__sudo "exec $0 $script_options"
|
||||||
|
exit
|
||||||
|
fi ;;&
|
||||||
!(--public|-4|-6|-46|-64) )
|
!(--public|-4|-6|-46|-64) )
|
||||||
f_affichage
|
f_affichage
|
||||||
echo ;;&
|
echo ;;&
|
||||||
-i | --install | -r | --remove )
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
|
||||||
f__info "vous devez être$RED ROOT$BLUE pour cette opération"
|
|
||||||
f__sudo "exec $0 $*"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
;;&
|
|
||||||
-i | --install | -r | --remove | -u | --upgrade | -us )
|
-i | --install | -r | --remove | -u | --upgrade | -us )
|
||||||
test_user ;;&
|
test_user ;;&
|
||||||
|
|
||||||
-4 | --ip4 ) # affiche ip v4 public
|
-4 | --ip4 ) # affiche ip v4 public
|
||||||
fi_ip_pub "-4" ;;
|
fi_ip_pub "-4" ;;
|
||||||
-6 | --ip6 ) # affiche ip v6 public
|
-6 | --ip6 ) # affiche ip v6 public
|
||||||
|
@ -886,7 +959,8 @@ for j in $options; do
|
||||||
-46 | -64 | --public ) # ip v4 & v6
|
-46 | -64 | --public ) # ip v4 & v6
|
||||||
fi_ip_pub "-46" ;;
|
fi_ip_pub "-46" ;;
|
||||||
--local ) # affiche ip locales
|
--local ) # affiche ip locales
|
||||||
fi_ip ;;
|
fi_ip ;;
|
||||||
|
|
||||||
-i | --install ) # installation du script dans le système
|
-i | --install ) # installation du script dans le système
|
||||||
fscript_install ;;
|
fscript_install ;;
|
||||||
-r | --remove ) # suppression du script dans le système
|
-r | --remove ) # suppression du script dans le système
|
||||||
|
|
|
@ -6,7 +6,7 @@ script="getThunderbird"
|
||||||
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getThunderbird/issues"
|
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getThunderbird/issues"
|
||||||
|
|
||||||
##### license LPRAB/WTFPL
|
##### license LPRAB/WTFPL
|
||||||
# auteur: simpledeb
|
# auteur: sdeb
|
||||||
# contributeurs: kyodev
|
# contributeurs: kyodev
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ script="getXfox"
|
||||||
#contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getXfox/issues"
|
#contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getXfox/issues"
|
||||||
|
|
||||||
##### license LPRAB/WTFPL
|
##### license LPRAB/WTFPL
|
||||||
# auteur: simpledeb
|
# auteur: sdeb
|
||||||
# contributeurs: kyodev
|
# contributeurs: kyodev
|
||||||
#####
|
#####
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue