Skip to content

Commit 0a51da2

Browse files
authored
Added validation if file exists
Added validation if file exists to not create, avoiding error when adding additional users with this command.
1 parent 7b2b895 commit 0a51da2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/v-add-web-domain-httpauth

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ sed -i "/^$auth_user:/d" $htpasswd
7878
echo "$auth_user:$auth_hash" >> $htpasswd
7979

8080
# Symbolic link for secure web templates
81-
ln -s $htpasswd $shtpasswd
81+
if [ ! -L $shtpasswd ]; then
82+
ln -s $htpasswd $shtpasswd
83+
fi
84+
if [ ! -L $shtaccess ]; then
8285
ln -s $htaccess $shtaccess
86+
fi
8387

8488
# Restarting web server
8589
if [ "$restart" != 'no' ] && [ "$restart_required" = 'yes' ]; then

0 commit comments

Comments
 (0)