From 3f08e0052cb096b9fef274727a61ddf154a6615d Mon Sep 17 00:00:00 2001 From: Jeff Ohrstrom Date: Wed, 13 Nov 2024 13:00:07 -0500 Subject: [PATCH] add shebangs to shell scripts and content to after.sh.erb (#2) --- template/after.sh.erb | 12 ++++++++++++ template/before.sh.erb | 2 ++ template/script.sh.erb | 1 + 3 files changed, 15 insertions(+) diff --git a/template/after.sh.erb b/template/after.sh.erb index e69de29..fbd586a 100755 --- a/template/after.sh.erb +++ b/template/after.sh.erb @@ -0,0 +1,12 @@ +#!/bin/bash + +# Wait for the Matlab server to start +echo "Waiting for Matlab server to open port ${port}..." +if wait_until_port_used "${host}:${port}" 600; then + echo "Discovered Matlab server listening on port ${port}!" +else + echo "Timed out waiting for Matlab server to open port ${port}!" + clean_up 1 +fi +sleep 2 + diff --git a/template/before.sh.erb b/template/before.sh.erb index a216be9..b7f54bf 100755 --- a/template/before.sh.erb +++ b/template/before.sh.erb @@ -1,3 +1,5 @@ +#!/bin/bash + [[ $(type -t module) == "function" ]] && export -f module port=$(find_port ${host}) diff --git a/template/script.sh.erb b/template/script.sh.erb index e1d5af3..0460924 100755 --- a/template/script.sh.erb +++ b/template/script.sh.erb @@ -1,3 +1,4 @@ +#!/bin/bash module purge module restore