Added (Check Duplicates Before Adding New User)

master
Abanoub Hany 2024-07-02 16:10:24 +03:00
parent 139af13643
commit 362df10602
1 changed files with 2 additions and 2 deletions

View File

@ -39,9 +39,9 @@ Alias /l2tp-manager $TARGET_DIR
EOT 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 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 fi
# Restart Apache to apply the changes # Restart Apache to apply the changes