From patchwork Mon May 15 22:47:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 9728159 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B89060386 for ; Mon, 15 May 2017 22:47:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5713628464 for ; Mon, 15 May 2017 22:47:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C2112885D; Mon, 15 May 2017 22:47:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C430628464 for ; Mon, 15 May 2017 22:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbdEOWrs (ORCPT ); Mon, 15 May 2017 18:47:48 -0400 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:31222 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752323AbdEOWrq (ORCPT ); Mon, 15 May 2017 18:47:46 -0400 X-IronPort-AV: E=Sophos;i="5.38,346,1491235200"; d="scan'208";a="18973678" Received: from mail-sn1nam01lp0115.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([207.46.163.115]) by ob1.hgst.iphmx.com with ESMTP; 16 May 2017 06:47:45 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-sharedspace-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OWWh5ybJECgdyDpIrPa1UsKG2OZsaewyNJ8raYe1V2U=; b=ScrnYcWXDGKtL8mnAhHsMufpEfBMuHx2ZcYuTqkbDyXjljfnB/YiwXatS4TsSJGa5DyuaT+/AqGzcfWhDLxoNZxo4VoIcCkE9HEgMYjfVQJQwFI3n/Bv9WVcsfHw/QSk+sWInQd1wxCj1JjuLT/TjK4tlkk4TZ7dJd4sWDpEPgw= Received: from CO2PR04CA0120.namprd04.prod.outlook.com (2603:10b6:104:7::22) by DM2PR04MB718.namprd04.prod.outlook.com (2a01:111:e400:2448::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16; Mon, 15 May 2017 22:47:43 +0000 Received: from CO1NAM04FT049.eop-NAM04.prod.protection.outlook.com (2a01:111:f400:7e4d::206) by CO2PR04CA0120.outlook.office365.com (2603:10b6:104:7::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1084.16 via Frontend Transport; Mon, 15 May 2017 22:47:43 +0000 Authentication-Results: spf=pass (sender IP is 63.163.107.21) smtp.mailfrom=sandisk.com; mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=bestguesspass action=none header.from=sandisk.com; Received-SPF: Pass (protection.outlook.com: domain of sandisk.com designates 63.163.107.21 as permitted sender) receiver=protection.outlook.com; client-ip=63.163.107.21; helo=milsmgep15.sandisk.com; Received: from milsmgep15.sandisk.com (63.163.107.21) by CO1NAM04FT049.mail.protection.outlook.com (10.152.91.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.1075.5 via Frontend Transport; Mon, 15 May 2017 22:47:42 +0000 Received: from MILHUBIP04.sdcorp.global.sandisk.com (Unknown_Domain [10.201.67.162]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 26.E1.29323.D003A195; Mon, 15 May 2017 15:47:41 -0700 (PDT) Received: from milsmgip11.sandisk.com (10.177.8.100) by MILHUBIP04.sdcorp.global.sandisk.com (10.177.9.97) with Microsoft SMTP Server id 14.3.319.2; Mon, 15 May 2017 15:47:37 -0700 X-AuditID: 0ac94369-548749800000728b-6d-591a300dd900 Received: from exp-402881.sdcorp.global.sandisk.com ( [10.177.8.100]) by (Symantec Messaging Gateway) with SMTP id 44.E3.11415.8003A195; Mon, 15 May 2017 15:47:36 -0700 (PDT) From: Bart Van Assche To: Doug Ledford CC: , Jason Gunthorpe , Leon Romanovsky , Bart Van Assche Subject: [PATCH rdma-core 1/5] srp_daemon.sh: Improve robustness Date: Mon, 15 May 2017 15:47:29 -0700 Message-ID: <20170515224733.29586-8-bart.vanassche@sandisk.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20170515224733.29586-1-bart.vanassche@sandisk.com> References: <20170515224733.29586-1-bart.vanassche@sandisk.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGLMWRmVeSWpSXmKPExsXCddJ5kS6vgVSkwcaXAhYvz39gtfh+w9Ti ZN8/Zotnh3pZHFg8nk0/zOTxfUcvo8f7fVfZPD5vkgtgieKySUnNySxLLdK3S+DKeHjlLnvB U+GKnvn/mBsYp/F3MXJySAiYSLw9sJW9i5GLQ0hgKZPE3TmrWSCcHYwSHY8amGCqnvX2MkMk NjNKnF20nR0kwSZgJPHt/UwWEFtEQE1i06tFYKOYBdYwSvzY8gusSFjAQeLAqX+MIDaLgKpE Y9NXsKm8AvYSzz5cZIfYIC9xdstOZhCbE6j+782nQDUcQNvsJX6eVgOZKSHQxCqxrO0+I0Sv oMTJmU/AFjMLSEgcfPECrFdIQF3i5JL5TBMYhWYhKZuFpGwBI9MqRrHczJzi3PTUAkNTveLE vJTM4my95PzcTYyQ0M7cwXj3ifchRgEORiUe3hUrJCOFWBPLiitzDzFKcDArifBycEtFCvGm JFZWpRblxxeV5qQWH2KU5mBREuc9JzM1QkggPbEkNTs1tSC1CCbLxMEp1cBYdmTGrjdJi2Uf KV1ieGuuNVU67WVQ2aW/iyIu6CusKWvsVdufvLk6ovls+556rVl7Gt/c+rN9tapsx0bjCeXs C50ypjr87+U+M2PWVtl7azY+zZ+ofjtollW4WNe/iltlU2elVJ938zEzmvjt0MRp5zjbZPb8 9lvmGHvn05W/NwT+/Dnjz/spVomlOCPRUIu5qDgRAAdfB21pAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrMJMWRmVeSWpSXmKPExsXCtZEjRZfDQCrSoGOvlcXBn22MFi/Pf2C1 +H7D1OJk3z9mi2eHelkcWD2eTT/M5PF9Ry+jx/t9V9k8pq05z+TxeZNcAGsUl01Kak5mWWqR vl0CV8bDK3fZC54KV/TM/8fcwDiNv4uRk0NCwETiWW8vcxcjF4eQwEZGicXXXzKCJNgEjCS+ vZ/JAmKLCKhJbHq1iB3EZhZYwyixcS9YXFjAQeLAqX9g9SwCqhKNTV+Zuhg5OHgF7CU+/GSD mC8vcXbLTmYQmxOo/O/Np2AlQkAlP0+rTWDkXsDIsIpRLDczpzg3PbPA0FCvODEvJbM4Wy85 P3cTIzgYOCN3MD6daH6IkYmDU6qBkVNN3en2ph72zrXOzFn3fp1vX35ePiTMce3OF781DMxE WJ7wJEzfGRqW/vO8nOAhn20bDZP7t4vyL+g6HbRz3e/OB0xZIXvcvdeyJMd7VfpN6nm4cmfL X7tLb/+tnhJS/CtRk+8zc9/pA6kbDX6df745ctejn01rerYK5vhlT15243LtldxyBSWW4oxE Qy3mouJEAGG/aK+2AQAA MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:63.163.107.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(39840400002)(39450400003)(39850400002)(39400400002)(39410400002)(39860400002)(2980300002)(438002)(189002)(199003)(9170700003)(6666003)(50226002)(8936002)(47776003)(36756003)(1076002)(4326008)(72206003)(305945005)(33646002)(106466001)(5003940100001)(81166006)(77096006)(575784001)(86362001)(76176999)(38730400002)(107886003)(50986999)(8676002)(110136004)(2950100002)(6916009)(53936002)(50466002)(5660300001)(54906002)(2906002)(478600001)(356003)(189998001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR04MB718; H:milsmgep15.sandisk.com; FPR:; SPF:Pass; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM04FT049; 1:T3Z1OS+jgMJR25DCsZ5mwtJJzJsJkyNJFq/vdLB0/VVAgkJty6x9jU0KxBcYbo/upNKXrM9efZLSY3lz4phZzH8YFvMNp7/ADKnuO8NsBqm0DGSEXui0JsPUcqkJJrQCsi07L8uq1gz90fNS/N10lpbyLSOUwTPzPQ5ugNkQb5d4CV0ckuSCQXrsrApX6NQ5iGJuBevv8xQNr9alBJ/2hCOp7JREFFYB4WhCpbUDQ6e/PZnATNK+OD3wS+bW9Yq52wER8Vfqyg1bTko0CsX5wxEF4N+Y6M/q4CixSNQp0bmvnQFWJV771E+tl+MnUx3cKZPdb//RmArTObop/nNiJ6BUAwdVG/Sja9sd6pxEtyOV0U36CtXyAEM4vvMCL4pco0O5wU3Se9sYuGOMRC97Upbdv8ilEmlnYx5fAU/jSvYrlqRCmD6Q5HaLEUMsHSPTykqc64k4f0Vti9EVXAl/6C8XTfLQV62Y9R75WMBJG6K0lYsoodkHQuYS6hR3wdwyq67MeWWmGSQWT680bYIWuHT9OXIfNUteN53VJ8PHCX6KlDvQdEM/+PJRTnh96jjw X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61eec4c9-378b-4e27-f0c1-08d49be465d5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(2017030254075)(201703131423075)(201703031133081)(201702281549075); SRVR:DM2PR04MB718; X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB718; 3:UMWb0XQWFlualUAfec8P04ubdZqn8hS2R09cwFRfBjYOtZwvCWRwgFSPxzZpxrKB4jPakqLZfwKjvYxnWiARKeoI1lmtaQps8icEyEmyZ41tjhIxDjcHCsTqT4OeuO+386C6AF7+Y3bpQ5s+PUm9gvi5m5oo2MXeBZQRQDA//PJ3WUP7m2LcE91N4+8XmSj7OUtQa+A3yKGpCOYdbQeaRGNRFfnnrcHbhGbfuR+JCE/MshgwcYMJTVD48bbY5wCFdSkiaFvGrtPrCF0j11a3UOcQL4pvdPXtXSQAhRDu2p9KTsDr/NfQvdTgl34TqBfL0ZYHptPiec1EI9/SyzfHQUuVysl/tvqNQgHy5GTX9vKbgUu3j//ZBbQZqImdig3avWKeMNENVW2+l69g4IR0DFFZKjR81OkvM5H41osPh76ag94D5tZZwMEZyTRyVa484mg8sIXfuM9QU968yiG6FPpFRPuxNMQaBlijrMGt4wizkRJIBCjjqsdxjNsRThvxOCefNYz+uyUUQi5ojrkWpw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB718; 25:vnMWlGexaQMUV4YM0w5vV5HWgSB0517e/LmD+c87+wuoQHna+PuYIYZMurwlLxascpK5IfRdzCL2kYyBfl8YAtR5wXXFLMLv+Jp+hvq6NexiPYVWXR9lCtS/dz+ndY+lnWp0+RvMEh1fZM4FxE/TiPv9CgPQvqGrS10FHRoOUBor3vm7SHEOyjGVLBeiuVKp5lF9khB0jGmc08PXUhInICaElG5obLXMBA5TNLDkJl8vU4qNbQ5Ka3Fhsd82KkZk0D5sjy88uTvuwx3IpzDSMBwu85IF3LD60u23C5nZt6ZafCskbT9/4zsfkt4SO1EFVSGof4tQ2tb0cFVTVth1KZ7rxbxVbgAt3BpyID1LLiHPKoploPQAGUhKfGfKGnLRpGNoNgDe9MsCV/8RZEJ+B5BaBaken10uo3peS1Y5lpg8bxinG3mdGtp9RtjEYg+ki4+wc6M97H1zE+YOMni9svT2gG3L53WX60k9ZY07G1Q=; 31:f2YwhXJGZaDKFj6xCOgFX6v6JuZztrGbKXEg0ANDT1tgb9PVUTClQ0k4UNvze12WDakkgx3mBzZdFlFu5IXJhJHbhJAASSuLEjijZNBuFt5HielWc6MT6jvRFVJm6nAi7eP5JFhg0gYXCTvYvwnId4/g8YrRHYbTMEcd6J1Pt40Soe83duFlMh49OM3bRFo2xhXfwsdCTEzyJLj2+Et/pwb3ldvEJuE2G2AaYF+xbhv1Ln8xQz37d4S6ZFLXZWQb WDCIPOUTBOUND: EOP-TRUE X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB718; 20:k0PdJYl6srnQPdqPbvah/JqzzP8xGz20jJIJpjeXed3ehfCJotgMH8AopNlyCsoColKCjv99IXFHuC9F1YKEDGKaYa9p7QqSnHrQxNak/PPxPQZGNOMiTew5p7GwOSVCtO0va0qCnpD0IPig+Ap0Xq8KGiHcWhpAZvBrHkSZ97fDp6yoyPZPlqRVQc4E92sjreXMLjGkDnFP4RU59CjAnSHfW6RGorjpXXAHXWJrp9Xs8wjHLZaSosHlUveG4LJqDy4RMko9JIfx9y7XD2sR+30GNWad3TszlfJt9PDhHcsXRm7G4r9s/S5Pq/L8zIzYq0ZTBM97SFM9KvO8EYyVCpLd1NOe3g9ItzZnWBww5kxCZAFX2Rn9GcS03PQ84sSnciQPTeumXvZjMda1gb1k+1PiTQmcC4lOHqs4xljEST16//dPVbmDgdJBJr2t91UQz94O6MxxLc9YYboGodKowIkyeG0Rk51tRT3cwxDgWrL26khdz2qmAGJBdVy5tBFm X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(42932892334569); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(13016025)(13018025)(10201501046)(3002001)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123560025)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148); SRVR:DM2PR04MB718; BCL:0; PCL:0; RULEID:; SRVR:DM2PR04MB718; X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB718; 4:Ngdslp5ZrClDTCk+/4bGjIFq1oVDfLg5Lm3ZOAM6JoEe2aQ7bWpiORvBQHf2KQ5Bc3S1E8v6g/pV5EYLRTJne5YINj0VYFHiR+vgZUHvjO6ptPMk+6kCDjmAkEL5eAmuIwpGDTV7dHeAU2wGQgqbUFTVORF2IVz4AltjS2eOHuQvHywCtQj9HFRqBOB0Qojza5nW14M3oPAUzV1vF3hHXeaFMl+/+7JO5IWO7/7jGwmbHNewpZUib7vwuIqZfYLaCgGj7X42H7ieXUVc2+3zKeneJL2oiScJAdMZRUv1AS7ZpmcnfmJXzfKAelr+Fj7I1H9Qu2u5awnYj6CQuMwW1nT04qehT1Clww0IST6rXlYKBUKGIulzr3xp5S7ZESZP5Y452DILB45ScDWj96VYdCFjIxdgr5bMzfdtGqBH/ffx/bmrRAIftpj5zDSL7ICn8SZpnYW0ogDU4n6Ifus4qzDmrGSU3HSnm842BtsQCN4BCRLN+q6ohaBSLmkklS3EC3oiX0LX73rKen3cCeTs6O5gL+U6SIyqk1MhCR4u5Q0+7k10MamJpxHQSqP2a7IbjUCU4OFtcZSZZXw7Q4J7YzsNi4EDOwq5rs5f09ykFuFGFyqqnZjtM+8Up3RvFGcrgsemtXLQFakMHM4XstdAp7gyeu98391CTjJlWOQSJVBEOqbK97SzsRuT8boDksB/kx5TIrvOLZfXgtB+m0887dYe/1vfLWNSmAmE5XEtZGgBHOt/4hnKPNj1vNlv7F3Chb09JB5I/+ADgyBQAK3anaRoK5hoOblsdoPvBfPbq5xpSKQ+2g4YR0LoOpJcx6VVQuuU+WuiNpnJnUhAVWlRrqk8ExhtLJtqXUsImenEkrDhany5IcTgGWgi8P5vGDow X-Forefront-PRVS: 0308EE423E X-Microsoft-Exchange-Diagnostics: =?us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Zx894BgQKRv/aeVijYZNH9758OjZePeOEKZJ4QPx7F+3nzljQT/+mwj/L42Dh+LxeffWXG/fJyWjU5iBl/EmJ0KLYIYa87huuUSW1q21abk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR04MB718; 7:gGfUBzRJRV3D6MeNSSiKA5VxBA41+WJLSpL9RnZ+mgoOYvn5eSoOBqs8SQcbDLRq/VU9ewvBjraKIWJqIJRR185keQmdJWBHdltgvdd0cca/+6emPdhOQG70AbADK/Z7lbbG6+UauOFWwpkaT1Xhvoyi2yhYXhqex6mi0rIamJeySL7a7LJxFfSK+ooGFQDs+LiIR+McB6JBte0XR2g7zrDLLhqCnzGIBJitvr86Ofb2nLhci3nzvS8U9+OkAV2tq3orIFX3mwUCAHZEPrBHZVjp2BnECMTUH3S4/E4lzSDSvmG52Md5IeJFX+7rDUHR0x/8g1V9sqlIoRtKxB6ROw==; 20:6+yc1HH9okNj/sIEFCmUWsoFpPZzm0D05PC43xuzUx43gNvTdJh0L2c8QbA7Op6fAnXODC7nn5qQgGGv4gWbKlVq7JkeeTHTCUOXrXOfTn3TeNXOGnte+GpFItV0XR5wXp1t2cCy7sqK7CxAvm523bBO/bCVn9drNh1BYWmYOus= X-OriginatorOrg: sandisk.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 May 2017 22:47:42.6794 (UTC) X-MS-Exchange-CrossTenant-Id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=b61c8803-16f3-4c35-9b17-6f65f441df86; Ip=[63.163.107.21]; Helo=[milsmgep15.sandisk.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR04MB718 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Surround expansions of shell variables that can contain spaces with double quotes. Use arrays instead of a space-separated strings to store lists to avoid that strings that contain whitespace get split when iterating over a list. Signed-off-by: Bart Van Assche --- srp_daemon/srp_daemon.sh.in | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/srp_daemon/srp_daemon.sh.in b/srp_daemon/srp_daemon.sh.in index cb0b81ef..75e8a31b 100755 --- a/srp_daemon/srp_daemon.sh.in +++ b/srp_daemon/srp_daemon.sh.in @@ -31,35 +31,35 @@ shopt -s nullglob prog=@CMAKE_INSTALL_FULL_SBINDIR@/srp_daemon -params=$@ +params=("$@") ibdir="/sys/class/infiniband" rescan_interval=60 -pids="" -pidfile=@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon.sh.pid +pids=() +pidfile="@CMAKE_INSTALL_FULL_RUNDIR@/srp_daemon.sh.pid" mypid=$$ trap_handler() { - if [ -n "$pids" ]; then - kill -15 $pids > /dev/null 2>&1 - wait $pids + if [ "${#pids[@]}" ]; then + kill -15 "${pids[@]}" > /dev/null 2>&1 + wait "${pids[@]}" fi - logger -i -t "$(basename $0)" "killing $prog." - /bin/rm -f $pidfile + logger -i -t "$(basename "$0")" "killing $prog." + /bin/rm -f "$pidfile" exit 0 } # Check if there is another copy running of srp_daemon.sh -if [ -f $pidfile ]; then - if [ -e /proc/$(cat $pidfile 2>/dev/null)/status ]; then - echo "$(basename $0) is already running. Exiting." +if [ -f "$pidfile" ]; then + if [ -e "/proc/$(cat "$pidfile" 2>/dev/null)/status" ]; then + echo "$(basename "$0") is already running. Exiting." exit 1 else - /bin/rm -f $pidfile + /bin/rm -f "$pidfile" fi fi -if ! echo $mypid > $pidfile; then +if ! echo $mypid > "$pidfile"; then echo "Creating $pidfile for pid $mypid failed" exit 1 fi @@ -72,12 +72,12 @@ do done for d in ${ibdir}_mad/umad*; do - hca_id="$(<$d/ibdev)" - port="$(<$d/port)" + hca_id="$(<"$d/ibdev")" + port="$(<"$d/port")" add_target="${ibdir}_srp/srp-${hca_id}-${port}/add_target" if [ -e "${add_target}" ]; then - ${prog} -e -c -n -i ${hca_id} -p ${port} -R ${rescan_interval} ${params} >/dev/null 2>&1 & - pids="$pids $!" + ${prog} -e -c -n -i "${hca_id}" -p "${port}" -R "${rescan_interval}" "${params[@]}" >/dev/null 2>&1 & + pids+=($!) fi done