From 635bc85235c1a6a36f6528d73230c69e64afa2cb Mon Sep 17 00:00:00 2001 From: Antoine Ginies Date: Wed, 29 Jun 2005 00:48:14 +0000 Subject: test if samba user exist (avoid remove an existing password) --- samba_wizard/Sambashare.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'samba_wizard') diff --git a/samba_wizard/Sambashare.pm b/samba_wizard/Sambashare.pm index 932db9a1..1c43f9a4 100755 --- a/samba_wizard/Sambashare.pm +++ b/samba_wizard/Sambashare.pm @@ -500,7 +500,9 @@ sub create_smbuser { my ($list)= @_; my @users = split(" ", $list); foreach my $user (@users) { - system("smbpasswd -a $user -n"); + if (!any { /^$user:/ } cat_("/etc/samba/smbpasswd") ) { + system("smbpasswd -a $user -n"); + } } } -- cgit v1.2.1