bunkerweb/examples/drupal/setup-linux.sh

27 lines
653 B
Bash
Raw Normal View History

#!/bin/bash
if [ $(id -u) -ne 0 ] ; then
echo "❌ Run me as root"
exit 1
fi
2022-08-17 12:01:18 +00:00
if id www-data > /dev/null 2>&1 ; then
user="www-data"
elif id apache > /dev/null 2>&1 ; then
user="apache"
else
echo "❌ No PHP user found"
exit 1
fi
2022-08-17 14:21:36 +00:00
curl https://www.drupal.org/download-latest/tar.gz -Lo /tmp/drupal.tar.gz
tar -xzf /tmp/drupal.tar.gz -C /tmp
2022-08-17 14:43:34 +00:00
current_dir="$(pwd)"
2022-08-17 12:01:18 +00:00
cd /tmp/drupal-*
2022-11-11 13:55:04 +00:00
cp -r * /var/www/html
chown -R $user:nginx /var/www/html
find /var/www/html -type f -exec chmod 0640 {} \;
find /var/www/html -type d -exec chmod 0750 {} \;
2022-08-17 14:43:34 +00:00
cd "$current_dir"
2022-11-11 13:55:04 +00:00
cp -r ./bw-data/configs/* /etc/bunkerweb/configs
chown -R nginx:nginx /etc/bunkerweb/configs