-
Notifications
You must be signed in to change notification settings - Fork 3
/
prepare.sh
67 lines (59 loc) · 2.08 KB
/
prepare.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -e
# scripts/00-update.sh
cat <<EOF
Updating system packages...
This could take some minutes
EOF
# stop prompts
sed -i 's/#$nrconf{restart} = '"'"'i'"'"';/$nrconf{restart} = '"'"'a'"'"';/g' /etc/needrestart/needrestart.conf || true
update() {
DEBIAN_FRONTEND=noninteractive apt-get update -y -qq >/dev/null
apt-get upgrade -qq -y >/dev/null
}
update
apt-get install -qq -y ca-certificates apt-transport-https software-properties-common
apt-get install -qq -y mysql-server
apt-get install -qq -y ffmpeg
apt-get install -qq -y python3-certbot-apache unzip
add-apt-repository -y ppa:ondrej/php
add-apt-repository -y ppa:ondrej/apache2
apt-get install -qq -y apache2 libapache2-mod-php8.3
apt-get install -qq -y php8.3
apt-get install -qq -y php8.3-bcmath
apt-get install -qq -y php8.3-common
apt-get install -qq -y php8.3-cli
apt-get install -qq -y php8.3-curl
apt-get install -qq -y php8.3-fileinfo
apt-get install -qq -y php8.3-gd
apt-get install -qq -y php8.3-imagick
apt-get install -qq -y php8.3-intl
apt-get install -qq -y php8.3-mbstring
apt-get install -qq -y php8.3-mysql
apt-get install -qq -y php8.3-opcache
apt-get install -qq -y php8.3-pdo
apt-get install -qq -y php8.3-pdo-mysql
apt-get install -qq -y php8.3-xml
apt-get install -qq -y php8.3-xmlrpc
apt-get install -qq -y php8.3-zip
# composer
if ! command -v composer &>/dev/null; then
echo "Installing composer"
COMPOSER_CHECKSUM_VERIFY="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
COMPOSER_HASH_FILE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$COMPOSER_CHECKSUM_VERIFY" != "$COMPOSER_HASH_FILE" ]; then
echo >&2 'ERROR: Invalid Composer installer checksum'
rm composer-setup.php
exit 1
fi
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
rm composer-setup.php
chmod +x /usr/local/bin/composer
else
composer selfupdate
fi
# safe update
update
systemctl restart apache2
echo "[OK] Stack ready for Chevereto!"