mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-06-14 19:45:14 +02:00
Refactor A-B (#15075)
This commit is contained in:
+10
-6
@@ -35,8 +35,10 @@ function update_script() {
|
||||
$STD apt -y upgrade
|
||||
|
||||
msg_info "Creating Backup"
|
||||
rm -rf /opt/2fauth-backup
|
||||
mv /opt/2fauth /opt/2fauth-backup
|
||||
create_backup \
|
||||
/opt/2fauth/.env \
|
||||
/opt/2fauth/storage
|
||||
|
||||
if ! dpkg -l | grep -q 'php8.4'; then
|
||||
cp /etc/nginx/conf.d/2fauth.conf /etc/nginx/conf.d/2fauth.conf.bak
|
||||
fi
|
||||
@@ -46,11 +48,13 @@ function update_script() {
|
||||
PHP_VERSION="8.4" PHP_FPM="YES" setup_php
|
||||
sed -i 's/php8\.[0-9]/php8.4/g' /etc/nginx/conf.d/2fauth.conf
|
||||
fi
|
||||
|
||||
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth" "tarball"
|
||||
setup_composer
|
||||
cp /opt/2fauth-backup/.env /opt/2fauth/.env
|
||||
cp -r /opt/2fauth-backup/storage /opt/2fauth/storage
|
||||
cd /opt/2fauth || return
|
||||
restore_backup
|
||||
|
||||
msg_info "Configuring 2FAuth"
|
||||
cd /opt/2fauth
|
||||
export COMPOSER_ALLOW_SUPERUSER=1
|
||||
$STD composer install --no-dev --prefer-dist
|
||||
php artisan 2fauth:install
|
||||
@@ -58,7 +62,7 @@ function update_script() {
|
||||
chmod -R 755 /opt/2fauth
|
||||
$STD systemctl restart php8.4-fpm
|
||||
$STD systemctl restart nginx
|
||||
rm -rf /opt/2fauth-backup
|
||||
msg_ok "Configured 2FAuth"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
|
||||
Reference in New Issue
Block a user