# !/bin/bash # skript pro kontrolu zda eb předpis, který je v easyconfigs-it4i je nainstalován printf "\033c" NAME=$(hostname -f | cut -d '.' -f 2) if [ $NAME = "bullx" ]; then NAME="ANSELM" else NAME="SALOMON" fi printf "Prepare data for analyse ...\n" ml --show_hidden -t av 2>&1 > /dev/null| awk '{print $1 }' | grep -v "/apps/*" > /apps/easybuild/easyconfigs-it4i/ml_av if [ "$1" = "not" ]; then find /apps/easybuild/easyconfigs-it4i/ -type f -name "*.eb" | grep "_not_installed/*" | cut -d '/' -f 7,8 | sed 's/.eb//' > /apps/easybuild/easyconfigs-it4i/eb-it4i_tmp echo -n "" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-installed_from_not_installed.txt" echo -n "" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-warning-not.txt" else find /apps/easybuild/easyconfigs-it4i/ -type f -name "*.eb" | grep -v "_not_installed/*" | cut -d '/' -f 6,7 | sed 's/.eb//' > /apps/easybuild/easyconfigs-it4i/eb-it4i_tmp echo -n "" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-not_installed.txt" echo -n "" > "/apps/easybuild/easyconfigs-it4i/results/$NAME-warning.txt" fi while read i; do a=$(echo $i | cut -d '/' -f 1); b=$(echo $i | sed -rn "s/$a\/$a[-]+(.*)/\1/p"); echo "$a/$b" ;done < <(cat /apps/easybuild/easyconfigs-it4i/eb-it4i_tmp) > /apps/easybuild/easyconfigs-it4i/eb-it4i INSTALL="FALSE" format="%-80s %30s\n" red=$'\e[1;31m' grn=$'\e[1;32m' yel=$'\e[1;33m' blu=$'\e[1;34m' mag=$'\e[1;35m' cyn=$'\e[1;36m' end=$'\e[0m' while read x; do while read y; do if [ "$x" = "$y" ]; then INSTALL="OK" break fi done < <(cat /apps/easybuild/easyconfigs-it4i/ml_av) if [ ! "$INSTALL" = "OK" ]; then if [ -d "/apps/all/$x" ]; then INSTALL="WARNING" fi fi if [ "$INSTALL" = "OK" ]; then printf "$format" "$x" "${grn}installed${end}" if [ "$1" = "not" ]; then echo "installed from _not_installed ... $x" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-installed_from_not_installed.txt" fi INSTALL="FALSE" elif [ "$INSTALL" = "WARNING" ]; then printf "$format" "$x" "${yel}warning${end}" if [ "$1" = "not" ]; then echo "warning ... $x" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-warning-not.txt" else echo "warning ... $x" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-warning.txt" fi INSTALL="FALSE" else printf "$format" "$x" "${red}not installed${end}" if [ ! "$1" = "not" ]; then echo "not installed ... $x" >> "/apps/easybuild/easyconfigs-it4i/results/$NAME-not_installed.txt" fi INSTALL="FALSE" fi done < <(cat /apps/easybuild/easyconfigs-it4i/eb-it4i) rm /apps/easybuild/easyconfigs-it4i/eb-it4i /apps/easybuild/easyconfigs-it4i/ml_av /apps/easybuild/easyconfigs-it4i/eb-it4i_tmp