From a9c4a8aff202225cd02239c9c76e36ef76f88de4 Mon Sep 17 00:00:00 2001 From: Surya Prabhakar Date: Sat, 6 Oct 2012 19:35:56 +0530 Subject: [PATCH] kill throws an error while finding pid in quantum dhcp agent section Change-Id: I602df7875710336125cdbb8407ff293a8e7d448e --- unstack.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unstack.sh b/unstack.sh index 1bace156d6..49f1e8bb84 100755 --- a/unstack.sh +++ b/unstack.sh @@ -110,5 +110,6 @@ fi # Quantum dhcp agent runs dnsmasq if is_service_enabled q-dhcp; then - sudo kill -9 $(ps aux | awk '/[d]nsmasq.+interface=tap/ { print $2 }') + pid=$(ps aux | awk '/[d]nsmasq.+interface=tap/ { print $2 }') + [ ! -z $pid ] && sudo kill -9 $pid fi