From 0a51da259093b3620dfd407a84054720de38f159 Mon Sep 17 00:00:00 2001 From: Ramael Metatron Date: Thu, 20 Oct 2016 00:40:28 -0500 Subject: [PATCH] Added validation if file exists Added validation if file exists to not create, avoiding error when adding additional users with this command. --- bin/v-add-web-domain-httpauth | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/v-add-web-domain-httpauth b/bin/v-add-web-domain-httpauth index a99c989dd..04ed8354e 100755 --- a/bin/v-add-web-domain-httpauth +++ b/bin/v-add-web-domain-httpauth @@ -78,8 +78,12 @@ sed -i "/^$auth_user:/d" $htpasswd echo "$auth_user:$auth_hash" >> $htpasswd # Symbolic link for secure web templates -ln -s $htpasswd $shtpasswd +if [ ! -L $shtpasswd ]; then + ln -s $htpasswd $shtpasswd +fi +if [ ! -L $shtaccess ]; then ln -s $htaccess $shtaccess +fi # Restarting web server if [ "$restart" != 'no' ] && [ "$restart_required" = 'yes' ]; then