Skip to content

Commit

Permalink
Merge pull request #4 from RadPaperDinosaur/main
Browse files Browse the repository at this point in the history
first pull request; just a simple edit to greatly improve bash code
  • Loading branch information
svpernova09 authored Sep 10, 2024
2 parents a5c6982 + 2e679a5 commit d2bda17
Showing 1 changed file with 5 additions and 35 deletions.
40 changes: 5 additions & 35 deletions scripts/clear-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,10 @@

# Clear The Old Environment Variables

sed -i '/# Set Homestead Environment Variable/,+1d' /home/vagrant/.profile

if [ -f /etc/php/5.6/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/5.6/fpm/pool.d/www.conf
fi

if [ -f /etc/php/7.0/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/7.0/fpm/pool.d/www.conf
fi

if [ -f /etc/php/7.1/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/7.1/fpm/pool.d/www.conf
fi

if [ -f /etc/php/7.2/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/7.2/fpm/pool.d/www.conf
fi
versions=(5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2)

if [ -f /etc/php/7.3/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/7.3/fpm/pool.d/www.conf
fi

if [ -f /etc/php/7.4/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/7.4/fpm/pool.d/www.conf
fi

if [ -f /etc/php/8.0/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/8.0/fpm/pool.d/www.conf
fi

if [ -f /etc/php/8.1/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/8.1/fpm/pool.d/www.conf
fi
sed -i '/# Set Homestead Environment Variable/,+1d' /home/vagrant/.profile

if [ -f /etc/php/8.2/fpm/pool.d/www.conf ]; then
sed -i '/env\[.*/,+1d' /etc/php/8.2/fpm/pool.d/www.conf
fi
for version in ${versions[@]}; do
[[ -f /etc/php/$version/fpm/pool.d/www.conf ]] && sed -i '/env\[.*/,+1d' /etc/php/$version/fpm/pool.d/www.conf
done

0 comments on commit d2bda17

Please sign in to comment.