Skip to content

Commit c1d76ef

Browse files
authored
Stop relying on Bash being located at /bin/bash (#580)
1 parent a1dd945 commit c1d76ef

File tree

5 files changed

+6
-8
lines changed

5 files changed

+6
-8
lines changed

resources/images/bitcoin/insecure/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
set -e
33

44
if [ "$(echo "$1" | cut -c1)" = "-" ]; then

resources/scripts/connect_logging.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22
# NO `set -e` here so an error does not exit the script
33

44
POD_NAME=$(kubectl get pods --namespace warnet-logging -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=loki-grafana" -o jsonpath="{.items[0].metadata.name}")

resources/scripts/setup_user_contexts.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Function to check if a command exists
44
command_exists() {

src/warnet/bitcoin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def get_messages(tank_a: str, tank_b: str, chain: str):
189189
import subprocess
190190

191191
blob = subprocess.run(
192-
cmd, shell=True, capture_output=True, executable="/bin/bash"
192+
cmd, shell=True, capture_output=True, executable="bash"
193193
).stdout
194194

195195
# Parse the blob

src/warnet/process.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33

44
def run_command(command: str) -> str:
5-
result = subprocess.run(
6-
command, shell=True, capture_output=True, text=True, executable="/bin/bash"
7-
)
5+
result = subprocess.run(command, shell=True, capture_output=True, text=True, executable="bash")
86
if result.returncode != 0:
97
raise Exception(result.stderr)
108
return result.stdout
119

1210

1311
def stream_command(command: str) -> bool:
1412
process = subprocess.Popen(
15-
["/bin/bash", "-c", command],
13+
["bash", "-c", command],
1614
stdout=subprocess.PIPE,
1715
stderr=subprocess.STDOUT,
1816
text=True,

0 commit comments

Comments
 (0)