Просмотр исходного кода

Added validation if file exists

Added validation if file exists to not create, avoiding error when adding additional users with this command.
Ramael Metatron 9 лет назад
Родитель
Сommit
0a51da2590
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      bin/v-add-web-domain-httpauth

+ 5 - 1
bin/v-add-web-domain-httpauth

@@ -78,8 +78,12 @@ sed -i "/^$auth_user:/d" $htpasswd
 echo "$auth_user:$auth_hash" >> $htpasswd
 echo "$auth_user:$auth_hash" >> $htpasswd
 
 
 # Symbolic link for secure web templates
 # 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
 ln -s $htaccess $shtaccess
+fi
 
 
 # Restarting web server
 # Restarting web server
 if [ "$restart" != 'no' ] && [ "$restart_required" = 'yes' ]; then
 if [ "$restart" != 'no' ] && [ "$restart_required" = 'yes' ]; then