Explorar o código

Allow the docker scripts to be run from other directories

Ian Goldberg hai 6 meses
pai
achega
345e335e68
Modificáronse 2 ficheiros con 10 adicións e 0 borrados
  1. 5 0
      docker/build-docker
  2. 5 0
      docker/set-networking

+ 5 - 0
docker/build-docker

@@ -1,4 +1,9 @@
 #!/bin/bash
 
+# cd into the directory containing this script (from the bash faq 028)
+if [[ $BASH_SOURCE = */* ]]; then
+  cd -- "${BASH_SOURCE%/*}/" || exit
+fi
+
 cd ..
 docker build $* -t oram -f docker/Dockerfile .

+ 5 - 0
docker/set-networking

@@ -1,5 +1,10 @@
 #!/bin/bash
 
+# cd into the directory containing this script (from the bash faq 028)
+if [[ $BASH_SOURCE = */* ]]; then
+  cd -- "${BASH_SOURCE%/*}/" || exit
+fi
+
 latency=30ms
 bw=100mbit