Skip to content

Commit 4f2d808

Browse files
author
buildplan
committed
fix shellcheck warning
1 parent 0fc5512 commit 4f2d808

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

du_setup.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3718,7 +3718,7 @@ configure_2fa() {
37183718

37193719
if [[ "$SETUP_SUCCESS" == "false" ]]; then
37203720
print_info "Generating 2FA secret for $USERNAME..."
3721-
3721+
37223722
# Run google-authenticator non-interactively
37233723
# -t: time-based, -d: disallow reuse, -f: force to file, -r 3 -R 30: rate limit, -w 3: window size
37243724
if ! sudo -u "$USERNAME" google-authenticator -t -d -f -r 3 -R 30 -w 3 -q; then
@@ -3730,7 +3730,7 @@ configure_2fa() {
37303730
local SECRET
37313731
SECRET=$(head -n 1 "$GA_FILE")
37323732
local QR_LABEL="${USERNAME}@${SERVER_NAME}"
3733-
local QR_URL="otpauth://totp/${QR_LABEL}?secret=${SECRET}&issuer=$(hostname)"
3733+
local QR_URL; QR_URL="otpauth://totp/${QR_LABEL}?secret=${SECRET}&issuer=$(hostname)"
37343734

37353735
print_section "ACTION REQUIRED: Setup Authenticator App"
37363736
printf '%s\n' "${YELLOW}1. Open your Authenticator App (Google Auth, Authy, etc.)${NC}"
@@ -3812,16 +3812,16 @@ configure_2fa() {
38123812
print_info "Do NOT close this terminal."
38133813
print_info "Open a NEW terminal window and try to SSH in as $USERNAME."
38143814
print_info "You should be asked for your SSH Key passphrase (if set) FOLLOWED by the Verification Code."
3815-
3815+
38163816
if confirm "Was the login successful?"; then
38173817
print_success "2FA setup verified and active."
38183818
TWO_FACTOR_ENABLED=true
38193819
log "2FA enabled for user $USERNAME."
38203820
else
38213821
print_error "Login verification failed. Reverting 2FA changes..."
3822-
if [[ "$USE_DROPIN" == "true" ]]; then
3822+
if [[ "$USE_DROPIN" == "true" ]]; then
38233823
rm -f "$SSH_2FA_CONF"
3824-
else
3824+
else
38253825
# Basic cleanup for non-dropin
38263826
sed -i "/Match User $USERNAME/,+3d" /etc/ssh/sshd_config
38273827
fi

0 commit comments

Comments
 (0)