Skip to content

Commit 1a90d90

Browse files
authored
2FAuth: Improve Update-Check (#5998)
1 parent 11f1e86 commit 1a90d90

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ct/2fauth.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ function update_script() {
2828
msg_error "No ${APP} Installation Found!"
2929
exit
3030
fi
31-
RELEASE=$(curl -fsSL https://api.github.com/repos/Bubka/2FAuth/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
32-
if [[ "${RELEASE}" != "$(cat ~/.2fauth 2>/dev/null || cat /opt/2fauth_version.txt 2>/dev/null)" ]]; then
31+
if ! command -v jq &>/dev/null; then
32+
$STD apt-get install -y jq
33+
fi
34+
RELEASE=$(curl -fsSL https://api.github.com/repos/Bubka/2FAuth/releases/latest | jq -r '.tag_name' | sed 's/^v//')
35+
if [[ "${RELEASE}" != "$(cat ~/.2fauth 2>/dev/null)" ]] || [[ ! -f ~/.2fauth ]]; then
3336
msg_info "Updating $APP to ${RELEASE}"
3437
$STD apt-get update
3538
$STD apt-get -y upgrade
@@ -45,10 +48,11 @@ function update_script() {
4548
$STD apt-get install -y \
4649
lsb-release \
4750
gnupg2
48-
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,fpm,mysql,cli" setup_php
51+
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli" PHP_FPM="YES" setup_php
4952
sed -i 's/php8.2/php8.3/g' /etc/nginx/conf.d/2fauth.conf
5053
fi
5154
fetch_and_deploy_gh_release "2fauth" "Bubka/2FAuth"
55+
setup_composer
5256
mv "/opt/2fauth-backup/.env" "/opt/2fauth/.env"
5357
mv "/opt/2fauth-backup/storage" "/opt/2fauth/storage"
5458
cd "/opt/2fauth" || return

install/2fauth-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ $STD apt-get install -y \
1919
nginx
2020
msg_ok "Installed Dependencies"
2121

22-
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,fpm,mysql,cli" setup_php
22+
PHP_VERSION="8.3" PHP_MODULE="common,ctype,fileinfo,mysql,cli" PHP_FPM="YES" setup_php
2323
setup_composer
2424
setup_mariadb
2525

0 commit comments

Comments
 (0)