getIp 2.11.1

This commit is contained in:
kyodev 2018-03-05 03:52:18 +01:00
parent d5eabaff65
commit 0f7525ad07
2 changed files with 14 additions and 10 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
version=2.11.0 version=2.11.1
date="03/03/2018" date="04/03/2018"
projet="simpledeb" projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/" contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
script="getIp" script="getIp"
@ -138,10 +138,10 @@ f__requis(){ # 26/01/2018
packagesMissing=${packagesMissing% } packagesMissing=${packagesMissing% }
# affichage final # affichage final
if [ "$commandsMissing" ] && [ "$ENV_DEBIAN" ]; then if [ "$commandsMissing" ] && [ "$ENV_DEBIAN" ]; then
$c_echo "$RED""erreur critique, manquant: $STD$BOLD$commandsMissing" \ $c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing" \
"vous devriez exécuter:$GREEN apt install $packagesMissing" "vous devriez exécuter:$GREEN apt install $packagesMissing"
elif [ "$commandsMissing" ]; then elif [ "$commandsMissing" ]; then
$c_echo "$RED""erreur critique, manquant: $STD$BOLD$commandsMissing" $c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing"
fi fi
[ "$commandsMissing" ] && return 1 || return 0 [ "$commandsMissing" ] && return 1 || return 0
@ -332,8 +332,8 @@ f_affichage(){ # 24/01/2018
f_help(){ # 24/01/2018 f_help(){ # 24/01/2018
local ligne help=( local ligne help=(
"-----------------------------------------------------------------------" "-----------------------------------------------------------------------"
"$GREEN""./getIp$STD : exécution script" "${GREEN}./getIp$STD : exécution script"
"$GREEN""getIp$STD : exécution script installé dans le système" "${GREEN}getIp$STD : exécution script installé dans le système"
"" ""
"ce script requiert une des commandes suivantes pour déterminer l'ip publique:" "ce script requiert une des commandes suivantes pour déterminer l'ip publique:"
" dig (dnsutils) | wget | curl | telnet | nc" " dig (dnsutils) | wget | curl | telnet | nc"
@ -635,7 +635,7 @@ fscript_get_version(){ # 24/01/2018
if [[ "$ver_script_online" && "$script_install" ]]; then if [[ "$ver_script_online" && "$script_install" ]]; then
[ "$ver_script_install" != "$ver_script_online" ] && script_a_jour="KO" || script_a_jour="ok" [ "$ver_script_install" != "$ver_script_online" ] && script_a_jour="KO" || script_a_jour="ok"
fi fi
[ "$ver_script_online" ] || ver_script_online="$RED""n/a" [ "$ver_script_online" ] || ver_script_online="${RED}n/a"
[ "$ver_script_install" ] || ver_script_install="Non installé" [ "$ver_script_install" ] || ver_script_install="Non installé"
[ "$1" == "quiet" ] && return 0 [ "$1" == "quiet" ] && return 0
@ -647,7 +647,7 @@ fscript_get_version(){ # 24/01/2018
fscript_install(){ # 24/02/2018 fscript_install(){ # 24/02/2018
if grep -Eq "$script_install|/usr/bin/$script" <<< "$0"; then if grep -Eq "$script_install|/usr/bin/$script" <<< "$0"; then
f__info "$RED""l'installation dans le système doit se faire depuis le script non installé $GREEN(./$script -i )" f__info "${RED}l'installation dans le système doit se faire depuis le script non installé $GREEN(./$script -i )"
return 1 return 1
fi fi
type -t fscript_install_special &>/dev/null && fscript_install_special # test, si fonction spécifique, appel type -t fscript_install_special &>/dev/null && fscript_install_special # test, si fonction spécifique, appel
@ -672,7 +672,7 @@ fscript_install(){ # 24/02/2018
fscript_remove(){ # 24/02/2018 fscript_remove(){ # 24/02/2018
if ! grep -Eq "$script_install|/usr/bin/$script" <<< "$0"; then if ! grep -Eq "$script_install|/usr/bin/$script" <<< "$0"; then
f__info "$RED""cette fonction doit être appelée depuis le script installé dans le système $GREEN($script -r)" f__info "${RED}cette fonction doit être appelée depuis le script installé dans le système $GREEN($script -r)"
return 1 return 1
fi fi
if [ ! -x "$script_install" ];then if [ ! -x "$script_install" ];then
@ -696,7 +696,7 @@ fscript_update(){ # 01/03/2018
type -t fscript_update_special &>/dev/null && fscript_update_special # test, si fonction spécifique, appel type -t fscript_update_special &>/dev/null && fscript_update_special # test, si fonction spécifique, appel
if [ -z "$upgradeEnPlace" ] && ! grep -Eq "$script_install|/usr/bin/$script" <<< "$0"; then if [ -z "$upgradeEnPlace" ] && ! grep -Eq "$script_install|/usr/bin/$script" <<< "$0"; then
f__info "$RED""cette fonction doit être appelée depuis le script installé dans le système $GREEN($script -u)" f__info "${RED}cette fonction doit être appelée depuis le script installé dans le système $GREEN($script -u)"
return 1 return 1
fi fi
(( x_script_get_version == 1 )) || fscript_get_version (( x_script_get_version == 1 )) || fscript_get_version

View File

@ -1,6 +1,10 @@
# changelog getIp # changelog getIp
## getIp 2.11.1 04/03/2018
* cosmétique
## getIp 2.11.0 03/03/2018 ## getIp 2.11.0 03/03/2018
* synchro: fscript_install, fscript_remove, fscript_update * synchro: fscript_install, fscript_remove, fscript_update