bunkerweb/examples/moodle/setup-linux.sh

22 lines
537 B
Bash
Raw Normal View History

2022-08-17 12:01:18 +00:00
#!/bin/bash
if [ $(id -u) -ne 0 ] ; then
echo "❌ Run me as root"
exit 1
fi
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-12-05 10:47:56 +00:00
curl https://download.moodle.org/download.php/direct/stable401/moodle-4.1.tgz -Lo /tmp/moodle.tgz
tar -xzf /tmp/moodle.tgz -C /tmp
2022-11-11 13:55:04 +00:00
cp -r /tmp/moodle/* /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 {} \;