homebrew.sh
Notification si php.ini a été modifié
This commit is contained in:
@@ -26,8 +26,9 @@ no_distract=false
|
||||
|
||||
notification() {
|
||||
sound="Basso"
|
||||
title="Attention !!!"
|
||||
message="$1 was modified in the last 5 minutes"
|
||||
title="Homebrew"
|
||||
#subtitle="Attention !!!"
|
||||
message="$1"
|
||||
image="error.png"
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v terminal-notifier)" ]; then
|
||||
@@ -82,6 +83,9 @@ if [ -n "$upd3" ]; then
|
||||
echo ""
|
||||
done
|
||||
fi
|
||||
|
||||
touch /tmp/checkpoint
|
||||
|
||||
if [ "$no_distract" = false ]; then
|
||||
|
||||
a=$(echo -e "Do you wanna run \033[1mbrew upgrade "$upd3"\033[0m? (y/n)")
|
||||
@@ -160,21 +164,42 @@ if [ -n "$latest" ] && [ "$no_distract" = false ]; then
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "🍺 ️The Doc is checking that everything is ok."
|
||||
brew doctor
|
||||
brew missing
|
||||
echo ""
|
||||
|
||||
# Test if Apache conf file has been modified by Homebrew (Apache, PHP or Python updates)
|
||||
|
||||
v_apa=$(httpd -V | grep 'SERVER_CONFIG_FILE')
|
||||
conf_apa=$(echo "$v_apa" | awk -F "\"" '{print $2}')
|
||||
dir=$(dirname $conf_apa)
|
||||
name=$(basename $conf_apa)
|
||||
notif1="$dir has been modified in the last 5 minutes"
|
||||
|
||||
test=$(find $dir -name "$name" -mmin -5 -maxdepth 1)
|
||||
[ ! -z $test ] && echo -e "\033[1;31m❗️ ️$name was modified in the last 5 minutes\033[0m"
|
||||
[ ! -z $test ] && notification $dir
|
||||
[ ! -z $test ] && echo -e "\033[1;31m❗️ ️$notif1\033[0m"
|
||||
[ ! -z $test ] && notification "$notif1"
|
||||
|
||||
# Test if PHP.ini file has been modified by Homebrew (PECL)
|
||||
|
||||
php_versions=$(ls /usr/local/etc/php/)
|
||||
for php in $php_versions
|
||||
do
|
||||
# file modified since it was last read
|
||||
#if [ -N /usr/local/etc/php/$php/php.ini ]; then echo "modified"; fi
|
||||
|
||||
php_modified=$(find /usr/local/etc/php/$php/ -name php.ini -newer /tmp/checkpoint)
|
||||
php_ini=/usr/local/etc/php/$php/php.ini
|
||||
notif2="$php_ini has been modified"
|
||||
|
||||
[ ! -z $php_modified ] && echo -e "\033[1;31m❗️ ️$notif2\033[0m"
|
||||
[ ! -z $php_modified ] && notification "$notif2"
|
||||
|
||||
done
|
||||
echo ""
|
||||
|
||||
# Doctor
|
||||
|
||||
echo "🍺 ️The Doc is checking that everything is ok."
|
||||
brew doctor
|
||||
brew missing
|
||||
echo ""
|
||||
|
||||
# Homebrew 2.0.0+ run a cleanup every 30 days
|
||||
|
||||
|
||||
Reference in New Issue
Block a user