2021-04-24 00:41:14 +02:00
|
|
|
#!/bin/bash
|
|
|
|
NUMBER="-1"
|
|
|
|
|
2021-11-09 06:46:12 +01:00
|
|
|
if command -v sudo; then
|
|
|
|
sudo=$(which sudo)
|
|
|
|
elif command -v doas; then
|
|
|
|
sudo=$(which doas)
|
|
|
|
else
|
|
|
|
echo "Do you have installed sudo or doas on your system??"
|
|
|
|
fi
|
|
|
|
|
2021-04-24 00:41:14 +02:00
|
|
|
while true
|
|
|
|
do
|
|
|
|
clear
|
|
|
|
|
2021-11-09 06:46:12 +01:00
|
|
|
LOGS=( $(${sudo} find /var/tmp/portage/ -mindepth 1 -maxdepth 5 -name "build.log") $(${sudo} find /var/tmpnotmpfs/portage/ -mindepth 1 -maxdepth 5 -name "build.log") )
|
2021-04-24 00:41:14 +02:00
|
|
|
LEN=${#LOGS[@]}
|
|
|
|
|
|
|
|
for (( i=0; i<$LEN; i++ ));
|
|
|
|
do
|
|
|
|
echo "$(( $i + 1 )) - ${LOGS[$i]}"
|
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
read -rsp $'Select number to show logs...\n' -t2 -n1 NUMBER
|
|
|
|
|
|
|
|
[[ $NUMBER -gt 0 ]] && break
|
|
|
|
done
|
|
|
|
|
|
|
|
echo -e "\n\e[93m File: ${LOGS[$NUMBER-1]} \e[0m\n"
|
2021-11-09 06:46:12 +01:00
|
|
|
${sudo} tail -f "${LOGS[$NUMBER-1]}"
|