Skip to content

Commit 3bfc9fd

Browse files
authored
fix: Display message when adding user fails
1 parent ecda83e commit 3bfc9fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samba.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ if [ -f "$users" ] && [ -s "$users" ]; then
123123
fi
124124

125125
# Call the function with extracted values
126-
add_user "$config" "$username" "$uid" "$groupname" "$gid" "$password"
126+
add_user "$config" "$username" "$uid" "$groupname" "$gid" "$password" || { echo "Failed to add user $username"; exit 1; }
127127

128128
done < "$users"
129129

130130
else
131131

132-
add_user "$config" "$USER" "$UID" "$group" "$GID" "$PASS"
132+
add_user "$config" "$USER" "$UID" "$group" "$GID" "$PASS" || { echo "Failed to add user $username"; exit 1; }
133133

134134
if [[ "$RW" != [Ff0]* ]]; then
135135
# Set permissions for share directory if new (empty), leave untouched if otherwise

0 commit comments

Comments
 (0)