nfvbenchvm: add 2 debug features to build-image.sh
[nfvbench.git] / nfvbenchvm / dib / elements / nfvbenchvm / post-install.d / 03-copy-rc-local
old mode 100644 (file)
new mode 100755 (executable)
index 3311530..4a8e66b
@@ -1,8 +1,15 @@
 #!/bin/bash
 
+if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
+    set -x
+fi
+
+# Stop on error
+set -euo pipefail
+
 # set accurate rc.local file corresponding to current image built
 if [ $DIB_DEV_IMAGE = "loopvm" ]; then
     mv /etc/rc.d/rc.local.loopvm /etc/rc.d/rc.local
 else
     mv /etc/rc.d/rc.local.generator /etc/rc.d/rc.local
-fi
\ No newline at end of file
+fi