run_remote() { requestedcmd="'$*'" echo echo '---------------------------------------------------------------------------' echo Running $requestedcmd from https://$mgr/confluent-public/os/$profile/scripts/ tmpdir=$(mktemp -d) echo Executing in $tmpdir cd $tmpdir curl -f -sS https://$mgr/confluent-public/os/$profile/scripts/$1 > $1 if [ $? != 0 ]; then echo $requestedcmd failed to download; return 1; fi chmod +x $1 cmd=$1 shift ./$cmd $* retcode=$? echo "$requestedcmd exited with code $retcode" cd - > /dev/null return $retcode } run_remote_python() { echo echo '---------------------------------------------------------------------------' echo Running python script "'$*'" from https://$mgr/confluent-public/os/$profile/scripts/ tmpdir=$(mktemp -d) echo Executing in $tmpdir cd $tmpdir curl -f -sS https://$mgr/confluent-public/os/$profile/scripts/$1 > $1 if [ $? != 0 ]; then echo "'$*'" failed to download; return 1; fi python3 $* retcode=$? echo "'$*' exited with code $retcode" cd - > /dev/null return $retcode }