mirror of https://framagit.org/kyodev/kyopages.git
maj
This commit is contained in:
parent
a9b21222b4
commit
fb14903df8
|
@ -11,7 +11,7 @@
|
|||
> Ceux qui ne croient pas en l'avenir marketé _fabuleux_ de Quantum (publicité intégrée à venir, webextension limitées chez Mozilla, etc), qui présage plutôt un suivi sans saveur de Google Chrome, en attendant son abandon après une longue agonie déjà amorcée depuis longtemps, peuvent [tester Waterfox](https://framaclic.org/h/doc-getxfox)
|
||||
> Waterfox est un fork basé sur l'ancien moteur avec tout les extensions fonctionnelles et une bien plus grande liberté de personnalisation
|
||||
|
||||
![version: 4.25.0](https://img.shields.io/badge/version-4.25.0-blue.svg?longCache=true&style=for-the-badge)
|
||||
![version: 4.26.0](https://img.shields.io/badge/version-4.26.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)
|
||||
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# getFlashPlayer
|
||||
|
||||
|
||||
![version: 4.14.1](https://img.shields.io/badge/version-4.14.1-blue.svg?longCache=true&style=for-the-badge)
|
||||
![version: 4.15.0](https://img.shields.io/badge/version-4.15.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)
|
||||
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# getThunderbird
|
||||
|
||||
|
||||
![version: 2.10.1](https://img.shields.io/badge/version-2.10.1-blue.svg?longCache=true&style=for-the-badge)
|
||||
![version: 2.11.O](https://img.shields.io/badge/version-2.11.O-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)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# getXfox
|
||||
|
||||
![version: 4.17.1](https://img.shields.io/badge/version-4.17.1-blue.svg?longCache=true&style=for-the-badge)
|
||||
![version: 4.18.0](https://img.shields.io/badge/version-4.18.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)
|
||||
![license LPRAB / WTFPL](https://img.shields.io/badge/license-LPRAB%20%2F%20WTFPL-blue.svg?longCache=true&style=for-the-badge)
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=4.25.0
|
||||
date="26/06/2018"
|
||||
version=4.26.0
|
||||
date="03/07/2018"
|
||||
script="getFirefox"
|
||||
#contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFirefox/issues"
|
||||
|
||||
|
@ -134,8 +134,10 @@ f__read_file(){ # 13/06/2018
|
|||
|
||||
# recherche commandes/paquets, $1 liste: cmd1|cmd2[>paquet] (séparées par espaces) ex: "gawk|mawk>gawk wget"
|
||||
# si manque, return 1 & affiche commandes manquantes (si debian, ajout proposition paquet à installer)
|
||||
f__requis(){ # 11/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command commandsMissing packagesMissing
|
||||
# requiert f__sort_uniq
|
||||
f__requis(){ # 30/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command
|
||||
local commandsMissing packagesMissing t_commandsMissing t_packagesMissing
|
||||
|
||||
if type -p dpkg &>/dev/null ; then
|
||||
ENV_DEBIAN="oui" # debian
|
||||
|
@ -147,36 +149,76 @@ f__requis(){ # 11/06/2018
|
|||
fi
|
||||
for ireq in $1; do
|
||||
IFS='>' read -r cmds package <<< "$ireq" # ex: "awk|gawk>gawk wget file tar killall>psmisc"
|
||||
mapfile -t -d '|' commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]%$'\n'} # pas de packages dans les options, donc = commands[0]
|
||||
IFS='|' read -ra commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]} # pas de packages dans les options, donc = commands[0]
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
for command in "${commands[@]%$'\n'}"; do
|
||||
if type -p "$command" &>/dev/null ; then
|
||||
unset commandsMissing packagesMissing
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
break
|
||||
else # inexistant
|
||||
commandsMissing+="$command "
|
||||
packagesMissing+="$package "
|
||||
t_commandsMissing+="$command "
|
||||
t_packagesMissing="$package "
|
||||
fi
|
||||
done
|
||||
[ "$t_commandsMissing" ] && commandsMissing+="$t_commandsMissing "
|
||||
[ "$t_packagesMissing" ] && packagesMissing+="$t_packagesMissing "
|
||||
done
|
||||
|
||||
# dédoublonnage & triage
|
||||
commandsMissing=$( echo "$commandsMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
packagesMissing=$( echo "$packagesMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
# suppression éventuel espace final
|
||||
commandsMissing=${commandsMissing% }
|
||||
packagesMissing=${packagesMissing% }
|
||||
# dédoublonnage & tri
|
||||
commandsMissing=$( f__sort_uniq "$commandsMissing" )
|
||||
packagesMissing=$( f__sort_uniq "$packagesMissing" )
|
||||
|
||||
# affichage final
|
||||
if [ "$commandsMissing" ] && [ "$ENV_DEBIAN" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing$STD"
|
||||
elif [ "$commandsMissing" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD"
|
||||
fi
|
||||
|
||||
[ "$commandsMissing" ] && return 1 || return 0
|
||||
}
|
||||
|
||||
# options: liste à trier [-lf], affiche flat liste (\n enlevés en sortie) ou si -ln liste avec \n à chaque ligne
|
||||
# des caractères non permis =$/`... sont transformés en ø
|
||||
f__sort_uniq(){ # 02/07/2018
|
||||
local lf list array result item
|
||||
|
||||
while (( $# )) ; do
|
||||
case "$1" in
|
||||
-lf ) lf='yes' ;;
|
||||
* ) list=${1} ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
while read -r ; do # lecture ligne
|
||||
[ -z "$REPLY" ] && continue
|
||||
REPLY=${REPLY# } # trim gauche simple
|
||||
REPLY=${REPLY% } # trim droite simple
|
||||
REPLY=${REPLY// /\~} # espace remplacé avec ~
|
||||
# interdits/remplacés: ()/`; ø utilisé comme indicateur, ~ remplacé pas espace
|
||||
REPLY=${REPLY//[^a-zA-Z0-9~.,\{\}!\[\]#*%µ£°⇉:_+-]/ø} # caractère <> de autorisé remplacés par ø
|
||||
if [ "$lf" ]; then
|
||||
array+=( "${REPLY}" )
|
||||
else
|
||||
IFS='~' read -ra array <<< "$REPLY"
|
||||
fi
|
||||
done <<< "${list}"
|
||||
|
||||
result=$(
|
||||
for item in "${array[@]}"; do
|
||||
eval "alias ${item}=ls"
|
||||
done
|
||||
alias
|
||||
)
|
||||
result=${result//alias }
|
||||
result=${result//=\'ls\'}
|
||||
result=${result//\~/ }
|
||||
[ "$lf" ] && echo "${result}" || echo "${result//$'\n'/ }"
|
||||
}
|
||||
|
||||
# $@=cmd à lancer en root avec su ou sudo. si sudo possible: prioritairesu su
|
||||
f__sudo(){ # 11/06/2018
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=4.14.1
|
||||
date="13/06/2018"
|
||||
version=4.15.0
|
||||
date="03/07/2018"
|
||||
script="getFlashPlayer"
|
||||
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getFlashPlayer/issues"
|
||||
|
||||
|
@ -119,8 +119,10 @@ f__log(){ # 05/03/2018
|
|||
|
||||
# recherche commandes/paquets, $1 liste: cmd1|cmd2[>paquet] (séparées par espaces) ex: "gawk|mawk>gawk wget"
|
||||
# si manque, return 1 & affiche commandes manquantes (si debian, ajout proposition paquet à installer)
|
||||
f__requis(){ # 11/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command commandsMissing packagesMissing
|
||||
# requiert f__sort_uniq
|
||||
f__requis(){ # 30/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command
|
||||
local commandsMissing packagesMissing t_commandsMissing t_packagesMissing
|
||||
|
||||
if type -p dpkg &>/dev/null ; then
|
||||
ENV_DEBIAN="oui" # debian
|
||||
|
@ -132,36 +134,76 @@ f__requis(){ # 11/06/2018
|
|||
fi
|
||||
for ireq in $1; do
|
||||
IFS='>' read -r cmds package <<< "$ireq" # ex: "awk|gawk>gawk wget file tar killall>psmisc"
|
||||
mapfile -t -d '|' commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]%$'\n'} # pas de packages dans les options, donc = commands[0]
|
||||
IFS='|' read -ra commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]} # pas de packages dans les options, donc = commands[0]
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
for command in "${commands[@]%$'\n'}"; do
|
||||
if type -p "$command" &>/dev/null ; then
|
||||
unset commandsMissing packagesMissing
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
break
|
||||
else # inexistant
|
||||
commandsMissing+="$command "
|
||||
packagesMissing+="$package "
|
||||
t_commandsMissing+="$command "
|
||||
t_packagesMissing="$package "
|
||||
fi
|
||||
done
|
||||
[ "$t_commandsMissing" ] && commandsMissing+="$t_commandsMissing "
|
||||
[ "$t_packagesMissing" ] && packagesMissing+="$t_packagesMissing "
|
||||
done
|
||||
|
||||
# dédoublonnage & triage
|
||||
commandsMissing=$( echo "$commandsMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
packagesMissing=$( echo "$packagesMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
# suppression éventuel espace final
|
||||
commandsMissing=${commandsMissing% }
|
||||
packagesMissing=${packagesMissing% }
|
||||
# dédoublonnage & tri
|
||||
commandsMissing=$( f__sort_uniq "$commandsMissing" )
|
||||
packagesMissing=$( f__sort_uniq "$packagesMissing" )
|
||||
|
||||
# affichage final
|
||||
if [ "$commandsMissing" ] && [ "$ENV_DEBIAN" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing$STD"
|
||||
elif [ "$commandsMissing" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD"
|
||||
fi
|
||||
|
||||
[ "$commandsMissing" ] && return 1 || return 0
|
||||
}
|
||||
|
||||
# options: liste à trier [-lf], affiche flat liste (\n enlevés en sortie) ou si -ln liste avec \n à chaque ligne
|
||||
# des caractères non permis =$/`... sont transformés en ø
|
||||
f__sort_uniq(){ # 02/07/2018
|
||||
local lf list array result item
|
||||
|
||||
while (( $# )) ; do
|
||||
case "$1" in
|
||||
-lf ) lf='yes' ;;
|
||||
* ) list=${1} ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
while read -r ; do # lecture ligne
|
||||
[ -z "$REPLY" ] && continue
|
||||
REPLY=${REPLY# } # trim gauche simple
|
||||
REPLY=${REPLY% } # trim droite simple
|
||||
REPLY=${REPLY// /\~} # espace remplacé avec ~
|
||||
# interdits/remplacés: ()/`; ø utilisé comme indicateur, ~ remplacé pas espace
|
||||
REPLY=${REPLY//[^a-zA-Z0-9~.,\{\}!\[\]#*%µ£°⇉:_+-]/ø} # caractère <> de autorisé remplacés par ø
|
||||
if [ "$lf" ]; then
|
||||
array+=( "${REPLY}" )
|
||||
else
|
||||
IFS='~' read -ra array <<< "$REPLY"
|
||||
fi
|
||||
done <<< "${list}"
|
||||
|
||||
result=$(
|
||||
for item in "${array[@]}"; do
|
||||
eval "alias ${item}=ls"
|
||||
done
|
||||
alias
|
||||
)
|
||||
result=${result//alias }
|
||||
result=${result//=\'ls\'}
|
||||
result=${result//\~/ }
|
||||
[ "$lf" ] && echo "${result}" || echo "${result//$'\n'/ }"
|
||||
}
|
||||
|
||||
# $@=cmd à lancer en root avec su ou sudo. si sudo possible: prioritairesu su
|
||||
f__sudo(){ # 11/06/2018
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=2.10.1
|
||||
date="13/06/2018"
|
||||
version=2.11.O
|
||||
date="03/07/2018"
|
||||
script="getThunderbird"
|
||||
# contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getThunderbird/issues"
|
||||
|
||||
|
@ -134,8 +134,10 @@ f__read_file(){ # 13/06/2018
|
|||
|
||||
# recherche commandes/paquets, $1 liste: cmd1|cmd2[>paquet] (séparées par espaces) ex: "gawk|mawk>gawk wget"
|
||||
# si manque, return 1 & affiche commandes manquantes (si debian, ajout proposition paquet à installer)
|
||||
f__requis(){ # 11/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command commandsMissing packagesMissing
|
||||
# requiert f__sort_uniq
|
||||
f__requis(){ # 30/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command
|
||||
local commandsMissing packagesMissing t_commandsMissing t_packagesMissing
|
||||
|
||||
if type -p dpkg &>/dev/null ; then
|
||||
ENV_DEBIAN="oui" # debian
|
||||
|
@ -147,36 +149,76 @@ f__requis(){ # 11/06/2018
|
|||
fi
|
||||
for ireq in $1; do
|
||||
IFS='>' read -r cmds package <<< "$ireq" # ex: "awk|gawk>gawk wget file tar killall>psmisc"
|
||||
mapfile -t -d '|' commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]%$'\n'} # pas de packages dans les options, donc = commands[0]
|
||||
IFS='|' read -ra commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]} # pas de packages dans les options, donc = commands[0]
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
for command in "${commands[@]%$'\n'}"; do
|
||||
if type -p "$command" &>/dev/null ; then
|
||||
unset commandsMissing packagesMissing
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
break
|
||||
else # inexistant
|
||||
commandsMissing+="$command "
|
||||
packagesMissing+="$package "
|
||||
t_commandsMissing+="$command "
|
||||
t_packagesMissing="$package "
|
||||
fi
|
||||
done
|
||||
[ "$t_commandsMissing" ] && commandsMissing+="$t_commandsMissing "
|
||||
[ "$t_packagesMissing" ] && packagesMissing+="$t_packagesMissing "
|
||||
done
|
||||
|
||||
# dédoublonnage & triage
|
||||
commandsMissing=$( echo "$commandsMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
packagesMissing=$( echo "$packagesMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
# suppression éventuel espace final
|
||||
commandsMissing=${commandsMissing% }
|
||||
packagesMissing=${packagesMissing% }
|
||||
# dédoublonnage & tri
|
||||
commandsMissing=$( f__sort_uniq "$commandsMissing" )
|
||||
packagesMissing=$( f__sort_uniq "$packagesMissing" )
|
||||
|
||||
# affichage final
|
||||
if [ "$commandsMissing" ] && [ "$ENV_DEBIAN" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing$STD"
|
||||
elif [ "$commandsMissing" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD"
|
||||
fi
|
||||
|
||||
[ "$commandsMissing" ] && return 1 || return 0
|
||||
}
|
||||
|
||||
# options: liste à trier [-lf], affiche flat liste (\n enlevés en sortie) ou si -ln liste avec \n à chaque ligne
|
||||
# des caractères non permis =$/`... sont transformés en ø
|
||||
f__sort_uniq(){ # 02/07/2018
|
||||
local lf list array result item
|
||||
|
||||
while (( $# )) ; do
|
||||
case "$1" in
|
||||
-lf ) lf='yes' ;;
|
||||
* ) list=${1} ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
while read -r ; do # lecture ligne
|
||||
[ -z "$REPLY" ] && continue
|
||||
REPLY=${REPLY# } # trim gauche simple
|
||||
REPLY=${REPLY% } # trim droite simple
|
||||
REPLY=${REPLY// /\~} # espace remplacé avec ~
|
||||
# interdits/remplacés: ()/`; ø utilisé comme indicateur, ~ remplacé pas espace
|
||||
REPLY=${REPLY//[^a-zA-Z0-9~.,\{\}!\[\]#*%µ£°⇉:_+-]/ø} # caractère <> de autorisé remplacés par ø
|
||||
if [ "$lf" ]; then
|
||||
array+=( "${REPLY}" )
|
||||
else
|
||||
IFS='~' read -ra array <<< "$REPLY"
|
||||
fi
|
||||
done <<< "${list}"
|
||||
|
||||
result=$(
|
||||
for item in "${array[@]}"; do
|
||||
eval "alias ${item}=ls"
|
||||
done
|
||||
alias
|
||||
)
|
||||
result=${result//alias }
|
||||
result=${result//=\'ls\'}
|
||||
result=${result//\~/ }
|
||||
[ "$lf" ] && echo "${result}" || echo "${result//$'\n'/ }"
|
||||
}
|
||||
|
||||
# $@=cmd à lancer en root avec su ou sudo. si sudo possible: prioritairesu su
|
||||
f__sudo(){ # 11/06/2018
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
version=4.17.1
|
||||
date="13/06/2018"
|
||||
version=4.18.0
|
||||
date="03/07/2018"
|
||||
script="getXfox"
|
||||
#contact="IRC ##sdeb@freenode.net ou https://framagit.org/sdeb/getXfox/issues"
|
||||
|
||||
|
@ -134,8 +134,10 @@ f__read_file(){ # 13/06/2018
|
|||
|
||||
# recherche commandes/paquets, $1 liste: cmd1|cmd2[>paquet] (séparées par espaces) ex: "gawk|mawk>gawk wget"
|
||||
# si manque, return 1 & affiche commandes manquantes (si debian, ajout proposition paquet à installer)
|
||||
f__requis(){ # 11/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command commandsMissing packagesMissing
|
||||
# requiert f__sort_uniq
|
||||
f__requis(){ # 30/06/2018
|
||||
local ENV_DEBIAN c_echo ireq cmds package commands command
|
||||
local commandsMissing packagesMissing t_commandsMissing t_packagesMissing
|
||||
|
||||
if type -p dpkg &>/dev/null ; then
|
||||
ENV_DEBIAN="oui" # debian
|
||||
|
@ -147,36 +149,76 @@ f__requis(){ # 11/06/2018
|
|||
fi
|
||||
for ireq in $1; do
|
||||
IFS='>' read -r cmds package <<< "$ireq" # ex: "awk|gawk>gawk wget file tar killall>psmisc"
|
||||
mapfile -t -d '|' commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]%$'\n'} # pas de packages dans les options, donc = commands[0]
|
||||
IFS='|' read -ra commands <<< "${cmds}"
|
||||
[ -z "$package" ] && package=${commands[0]} # pas de packages dans les options, donc = commands[0]
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
for command in "${commands[@]%$'\n'}"; do
|
||||
if type -p "$command" &>/dev/null ; then
|
||||
unset commandsMissing packagesMissing
|
||||
unset t_commandsMissing t_packagesMissing
|
||||
break
|
||||
else # inexistant
|
||||
commandsMissing+="$command "
|
||||
packagesMissing+="$package "
|
||||
t_commandsMissing+="$command "
|
||||
t_packagesMissing="$package "
|
||||
fi
|
||||
done
|
||||
[ "$t_commandsMissing" ] && commandsMissing+="$t_commandsMissing "
|
||||
[ "$t_packagesMissing" ] && packagesMissing+="$t_packagesMissing "
|
||||
done
|
||||
|
||||
# dédoublonnage & triage
|
||||
commandsMissing=$( echo "$commandsMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
packagesMissing=$( echo "$packagesMissing" | tr ' ' '\n' | sort --unique | tr '\n' ' ' )
|
||||
# suppression éventuel espace final
|
||||
commandsMissing=${commandsMissing% }
|
||||
packagesMissing=${packagesMissing% }
|
||||
# dédoublonnage & tri
|
||||
commandsMissing=$( f__sort_uniq "$commandsMissing" )
|
||||
packagesMissing=$( f__sort_uniq "$packagesMissing" )
|
||||
|
||||
# affichage final
|
||||
if [ "$commandsMissing" ] && [ "$ENV_DEBIAN" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD" \
|
||||
"vous devriez exécuter:$GREEN apt install $packagesMissing$STD"
|
||||
elif [ "$commandsMissing" ]; then
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing"
|
||||
$c_echo "${RED}erreur critique, manquant: $STD$BOLD$commandsMissing$STD"
|
||||
fi
|
||||
|
||||
[ "$commandsMissing" ] && return 1 || return 0
|
||||
}
|
||||
|
||||
# options: liste à trier [-lf], affiche flat liste (\n enlevés en sortie) ou si -ln liste avec \n à chaque ligne
|
||||
# des caractères non permis =$/`... sont transformés en ø
|
||||
f__sort_uniq(){ # 02/07/2018
|
||||
local lf list array result item
|
||||
|
||||
while (( $# )) ; do
|
||||
case "$1" in
|
||||
-lf ) lf='yes' ;;
|
||||
* ) list=${1} ;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
while read -r ; do # lecture ligne
|
||||
[ -z "$REPLY" ] && continue
|
||||
REPLY=${REPLY# } # trim gauche simple
|
||||
REPLY=${REPLY% } # trim droite simple
|
||||
REPLY=${REPLY// /\~} # espace remplacé avec ~
|
||||
# interdits/remplacés: ()/`; ø utilisé comme indicateur, ~ remplacé pas espace
|
||||
REPLY=${REPLY//[^a-zA-Z0-9~.,\{\}!\[\]#*%µ£°⇉:_+-]/ø} # caractère <> de autorisé remplacés par ø
|
||||
if [ "$lf" ]; then
|
||||
array+=( "${REPLY}" )
|
||||
else
|
||||
IFS='~' read -ra array <<< "$REPLY"
|
||||
fi
|
||||
done <<< "${list}"
|
||||
|
||||
result=$(
|
||||
for item in "${array[@]}"; do
|
||||
eval "alias ${item}=ls"
|
||||
done
|
||||
alias
|
||||
)
|
||||
result=${result//alias }
|
||||
result=${result//=\'ls\'}
|
||||
result=${result//\~/ }
|
||||
[ "$lf" ] && echo "${result}" || echo "${result//$'\n'/ }"
|
||||
}
|
||||
|
||||
# $@=cmd à lancer en root avec su ou sudo. si sudo possible: prioritairesu su
|
||||
f__sudo(){ # 11/06/2018
|
||||
|
||||
|
|
Loading…
Reference in New Issue