From 80258a726274fad28dc25c2d5b2187f06445c075 Mon Sep 17 00:00:00 2001 From: Janek <6506725+jkrgr0@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:23:03 +0000 Subject: [PATCH] fix(2fauth): :bug: Use instead of for the directory name --- ct/2fauth.sh | 16 ++++++++-------- install/2fauth-install.sh | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ct/2fauth.sh b/ct/2fauth.sh index 0b7a9b2d..b58c2170 100644 --- a/ct/2fauth.sh +++ b/ct/2fauth.sh @@ -30,7 +30,7 @@ function update_script() { check_container_resources # Check if installation is present | -f for file, -d for folder - if [[ ! -d "/opt/${APP}" ]]; then + if [[ ! -d "/opt/${NSAPP}" ]]; then msg_error "No ${APP} Installation Found!" exit fi @@ -45,8 +45,8 @@ function update_script() { # Creating Backup msg_info "Creating Backup" - mv "/opt/${APP}" "/opt/${APP}-backup" - # tar -czf "/opt/${APP}_backup_$(date +%F).tar.gz" "/opt/${APP}" + mv "/opt/${NSAPP}" "/opt/${NSAPP}-backup" + # tar -czf "/opt/${NSAPP}_backup_$(date +%F).tar.gz" "/opt/${NSAPP}" msg_ok "Backup Created" # Execute Update @@ -54,12 +54,12 @@ function update_script() { wget -q "https://github.com/Bubka/2FAuth/archive/refs/tags/${RELEASE}.zip" unzip -q "${RELEASE}.zip" mv "${APPLICATION}-${RELEASE}/" "/opt/${APPLICATION}" - mv "/opt/${APP}-backup/.env" "/opt/${APP}/.env" - mv "/opt/${APP}-backup/storage" "/opt/${APP}/storage" - cd "/opt/${APP}" || return + mv "/opt/${NSAPP}-backup/.env" "/opt/${NSAPP}/.env" + mv "/opt/${NSAPP}-backup/storage" "/opt/${NSAPP}/storage" + cd "/opt/${NSAPP}" || return - chown -R www-data: "/opt/${APP}" - chmod -R 755 "/opt/${APP}" + chown -R www-data: "/opt/${NSAPP}" + chmod -R 755 "/opt/${NSAPP}" export COMPOSER_ALLOW_SUPERUSER=1 composer install --no-dev --prefer-source &>/dev/null diff --git a/install/2fauth-install.sh b/install/2fauth-install.sh index 5c97b9d0..ba0c49ad 100644 --- a/install/2fauth-install.sh +++ b/install/2fauth-install.sh @@ -49,9 +49,9 @@ msg_info "Setup ${APPLICATION}" RELEASE=$(curl -s https://api.github.com/repos/Bubka/2FAuth/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') wget -q "https://github.com/Bubka/2FAuth/archive/refs/tags/${RELEASE}.zip" unzip -q "${RELEASE}.zip" -mv "${APPLICATION}-${RELEASE}/" "/opt/${APPLICATION}" +mv "${APPLICATION}-${RELEASE}/" "/opt/${NSAPP}" -cd "/opt/${APP}" || return +cd "/opt/${NSAPP}" || return cp .env.example .env IPADDRESS=$(hostname -I | awk '{print $1}') @@ -63,8 +63,8 @@ sed -i -e "s|^APP_URL=.*|APP_URL=http://$IPADDRESS|" \ -e "s|^DB_USERNAME=$|DB_USERNAME=$DB_USER|" \ -e "s|^DB_PASSWORD=$|DB_PASSWORD=$DB_PASS|" .env -chown -R www-data: "/opt/${APPLICATION}" -chmod -R 755 "/opt/${APPLICATION}" +chown -R www-data: "/opt/${NSAPP}" +chmod -R 755 "/opt/${NSAPP}" export COMPOSER_ALLOW_SUPERUSER=1 $STD composer update --no-plugins --no-scripts @@ -77,15 +77,15 @@ $STD php artisan passport:install $STD php artisan storage:link $STD php artisan config:cache -echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt" -msg_ok "Setup ${APPLICATION}" +echo "${RELEASE}" >"/opt/${NSAPP}_version.txt" +msg_ok "Setup ${NSAPP}" # Configure Service (NGINX) msg_info "Configure Service" cat </etc/nginx/conf.d/2fauth.conf server { listen 80; - root /opt/${APPLICATION}/public; + root /opt/${NSAPP}/public; server_name $IPADDRESS; index index.php; charset utf-8;