2021-11-04 17:04:13

This commit is contained in:
gbaconni
2021-11-04 17:04:13 +01:00
parent bb850608d8
commit 2c2e9fb5ad
3 changed files with 11 additions and 3 deletions

Binary file not shown.

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ # # By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2021/11/04 12:36:53 by gbaconni #+# #+# # # Created: 2021/11/04 12:36:53 by gbaconni #+# #+# #
# Updated: 2021/11/04 16:52:32 by gbaconni ### lausanne.ch # # Updated: 2021/11/04 17:03:59 by gbaconni ### lausanne.ch #
# # # #
# **************************************************************************** # # **************************************************************************** #
@@ -61,7 +61,6 @@ ft_update ()
curl -sLo ${temp} 'https://vogsphere.baco.net/baco/born2beroot/raw/branch/master/monitoring.sh' curl -sLo ${temp} 'https://vogsphere.baco.net/baco/born2beroot/raw/branch/master/monitoring.sh'
if grep -q '^#42' ${temp} && bash -n ${temp} if grep -q '^#42' ${temp} && bash -n ${temp}
then then
while pidof -x monitoring.sh >/dev/null 2>&1; do sleep 0.1; done
cat ${temp} > /usr/local/bin/monitoring.sh cat ${temp} > /usr/local/bin/monitoring.sh
fi fi
rm -f ${temp} rm -f ${temp}
@@ -70,10 +69,18 @@ ft_update ()
main () main ()
{ {
test -f /etc/default/monitoring && source /etc/default/monitoring test -f /etc/default/monitoring && source /etc/default/monitoring
if [ "${MONITORING}" != "yes" ] if [ "${MONITORING}" != "yes" ] || [ "${1}" != "" ]
then then
return 0 return 0
fi fi
if [ "${1}" == "-f" ]
then
while [ 1 ]
do
${0}
sleep 3
done
fi
ft_arch ft_arch
ft_cpu ft_cpu
ft_memory ft_memory

1
test.sh Executable file
View File

@@ -0,0 +1 @@
sleep 3600