reinstall

This commit is contained in:
2019-08-10 09:28:27 +02:00
parent 0957a88ac8
commit 6adc6f1f71
3 changed files with 69 additions and 0 deletions

26
color-bash.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# prints a color table of 8bg * 8fg * 2 states (regular/bold)
echo
echo Table for 16-color terminal escape sequences.
echo Replace ESC with \\033 in bash.
echo
echo "Background | Foreground colors"
echo "---------------------------------------------------------------------"
for((bg=40;bg<=47;bg++)); do
for((bold=0;bold<=1;bold++)) do
echo -en "\033[0m"" ESC[${bg}m | "
for((fg=30;fg<=37;fg++)); do
if [ $bold == "0" ]; then
echo -en "\033[${bg}m\033[${fg}m [${fg}m "
else
echo -en "\033[${bg}m\033[1;${fg}m [1;${fg}m"
fi
done
echo -e "\033[0m"
done
echo "--------------------------------------------------------------------- "
done
echo
echo

7
modified.sh Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
dir="/usr/local/etc/httpd"
name="httpd.conf"
test=$(find $dir -name "$name" -mmin -2 -maxdepth 1)
#[ ! -z $test ] && echo "$name was modified in the last 2 minutes"
[ ! -z $test ] && echo -e "\033[1;31m❗ $name was modified in the last 5 minutes\033[0m"

36
tabColor.sh Executable file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
# Texte de l'exemple ( >= 3 caractères ) :
TEXT=" Bash " ;
# Couleur du texte :
declare -a FG=('' '1' '4' '5' '7' '30' '31' '32' \
'33' '34' '35' '36' '37') ;
echo
# Première ligne :
printf "FG \ BG\t%${#TEXT}s" ;
for bg in {40..47} ; do
printf "%${#TEXT}s" "${bg} " ;
done
echo ;
# Création du tableau de présentation des combinaisons :
for fg in ${!FG[*]} ; do
echo -ne "${FG[fg]}\t\033[${FG[fg]}m$TEXT" ;
for bg in {40..47} ; do
echo -ne "\033[${FG[fg]};${bg}m$TEXT\033[0m" ;
done
echo ;
done
# Comment déclarer une couleur :
cat <<_eof_
Format de déclaration : \\033[XXm où XX prend les valeurs
de FG ou BG" ;
Retour aux paramètres par défaut : \033[0m" ;
Pour plus de détails : http://www.admin-linux.fr/?p=9011
_eof_