[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [chutney/master] Use bash rather than the default shell



commit 0d57f921570789f05a6912fb88ad018a137fbb64
Author: teor <teor2345@xxxxxxxxx>
Date:   Mon Feb 27 16:02:13 2017 +1100

    Use bash rather than the default shell
    
    Closes #21563, related to tor's #21562.
---
 chutney                    | 2 +-
 tools/bootstrap-network.sh | 2 +-
 tools/hsaddress.sh         | 2 +-
 tools/test-network.sh      | 5 +++--
 tools/warnings.sh          | 2 +-
 5 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/chutney b/chutney
index 5fbc5d2..0d4b391 100755
--- a/chutney
+++ b/chutney
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
 
 set -o errexit
 set -o nounset
diff --git a/tools/bootstrap-network.sh b/tools/bootstrap-network.sh
index ed1ddf3..bbc77f7 100755
--- a/tools/bootstrap-network.sh
+++ b/tools/bootstrap-network.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/usr/bin/env bash
 #
 # 1. potentially stop running network
 # 2. bootstrap a network from scratch as quickly as possible
diff --git a/tools/hsaddress.sh b/tools/hsaddress.sh
index 5c8a828..c5d3a6f 100755
--- a/tools/hsaddress.sh
+++ b/tools/hsaddress.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Usage:
 #    tools/hsaddress.sh [hs_node]
diff --git a/tools/test-network.sh b/tools/test-network.sh
index a8d8bcd..2b60ec7 100755
--- a/tools/test-network.sh
+++ b/tools/test-network.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/usr/bin/env bash
 
 ECHO_N="/bin/echo -n"
 
@@ -218,7 +218,8 @@ export CHUTNEY_NETWORK="$CHUTNEY_PATH/networks/$NETWORK_FLAVOUR"
 # And finish up if we're doing a dry run
 if [ "$NETWORK_DRY_RUN" = true ]; then
     # we can't exit here, it breaks argument processing
-    return
+    # this only works in bash: return semantics are shell-specific
+    return 2>/dev/null || exit
 fi
 
 # Chutney must be launched at $CHUTNEY_PATH, at least until #21521 is fixed
diff --git a/tools/warnings.sh b/tools/warnings.sh
index bba2dcc..dfe5de7 100755
--- a/tools/warnings.sh
+++ b/tools/warnings.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
 #
 # Usage:
 #    tools/warnings.sh [node]

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits