streamupload/init
2022-09-06 12:39:26 +07:00

34 lines
797 B
Bash
Executable File

#!/usr/bin/env bash
set -e
# init - Initialize the container
cd /var/www
source vars
cp "/usr/share/zoneinfo/$tz" /etc/localtime
echo "$tz" >/etc/timezone
sed -i 's/upload_max_filesize = .*/upload_max_filesize = 10G/' /etc/php8/php.ini
sed -i 's/post_max_size = .*/post_max_size = 10G/' /etc/php8/php.ini
crond
line='SHELL=/bin/bash\n\n# Every minute\n* * * * * /var/www/encode\n\n# Streams'
echo -e "$line" |crontab -
[[ $interface ]] || interface=:80
sed -i "s/%interface%/$interface/" Caddyfile
chmod +x /usr/bin/caddy /usr/bin/mailer
up=
shopt -s nullglob
for u in "${!upw[@]}"
do up+="\t\t$u $(caddy hash-password --plaintext "${upw["$u"]}")#"
done
sed "s/%userpw%/$(echo -en "$up")/" Caddyfile |tr '#' '\n' >/srv/c
mv /srv/c Caddyfile
php-fpm8 -R
caddy start >caddy.log
sleep 9999d