From 362df10602ecbfb2631839afff1bafe53cd51509 Mon Sep 17 00:00:00 2001 From: h4775346 Date: Tue, 2 Jul 2024 16:10:24 +0300 Subject: [PATCH] Added (Check Duplicates Before Adding New User) --- sas4-install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sas4-install.sh b/sas4-install.sh index 21450b1..577c74d 100644 --- a/sas4-install.sh +++ b/sas4-install.sh @@ -39,9 +39,9 @@ Alias /l2tp-manager $TARGET_DIR EOT ) -# Add the new Alias and Directory block to the Apache configuration if it does not already exist +# Add the new Alias and Directory block above the existing Alias /user/api block if ! grep -q "/l2tp-manager/" $APACHE_CONF; then - awk -v insert="$ALIAS_BLOCK" '/ProxyRequests off/ {print; print insert; next}1' $APACHE_CONF > /tmp/sas4.conf && mv /tmp/sas4.conf $APACHE_CONF + awk -v insert="$ALIAS_BLOCK" '/Alias \/user\/api \/opt\/sas4\/site\/user\/backend\/public\// {print insert; print} !/Alias \/user\/api \/opt\/sas4\/site\/user\/backend\/public\// {print}' $APACHE_CONF > /tmp/sas4.conf && mv /tmp/sas4.conf $APACHE_CONF fi # Restart Apache to apply the changes