diff --git a/confluent_osdeploy/el7/profiles/default/scripts/functions b/confluent_osdeploy/el7/profiles/default/scripts/functions index 0f315999..5d6189e6 100644 --- a/confluent_osdeploy/el7/profiles/default/scripts/functions +++ b/confluent_osdeploy/el7/profiles/default/scripts/functions @@ -3,8 +3,11 @@ run_remote() { echo echo '---------------------------------------------------------------------------' echo Running $requestedcmd from https://$mgr/confluent-public/os/$profile/scripts/ - cd $(mktemp -d) + 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 if [ -x /usr/bin/chcon ]; then @@ -12,17 +15,24 @@ run_remote() { fi shift ./$cmd $* - echo "$requestedcmd exited with code $?" - cd - + 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/ - cd $(mktemp -d) + 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 /usr/libexec/platform-python $* - echo "'$*' exited with code $?" - cd - + retcode=$? + echo "'$*' exited with code $retcode" + cd - > /dev/null + return $retcode } diff --git a/confluent_osdeploy/el8/profiles/default/scripts/functions b/confluent_osdeploy/el8/profiles/default/scripts/functions index 0f315999..5d6189e6 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/functions +++ b/confluent_osdeploy/el8/profiles/default/scripts/functions @@ -3,8 +3,11 @@ run_remote() { echo echo '---------------------------------------------------------------------------' echo Running $requestedcmd from https://$mgr/confluent-public/os/$profile/scripts/ - cd $(mktemp -d) + 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 if [ -x /usr/bin/chcon ]; then @@ -12,17 +15,24 @@ run_remote() { fi shift ./$cmd $* - echo "$requestedcmd exited with code $?" - cd - + 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/ - cd $(mktemp -d) + 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 /usr/libexec/platform-python $* - echo "'$*' exited with code $?" - cd - + retcode=$? + echo "'$*' exited with code $retcode" + cd - > /dev/null + return $retcode } diff --git a/confluent_osdeploy/genesis/profiles/default/scripts/functions b/confluent_osdeploy/genesis/profiles/default/scripts/functions index 0f315999..5d6189e6 100644 --- a/confluent_osdeploy/genesis/profiles/default/scripts/functions +++ b/confluent_osdeploy/genesis/profiles/default/scripts/functions @@ -3,8 +3,11 @@ run_remote() { echo echo '---------------------------------------------------------------------------' echo Running $requestedcmd from https://$mgr/confluent-public/os/$profile/scripts/ - cd $(mktemp -d) + 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 if [ -x /usr/bin/chcon ]; then @@ -12,17 +15,24 @@ run_remote() { fi shift ./$cmd $* - echo "$requestedcmd exited with code $?" - cd - + 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/ - cd $(mktemp -d) + 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 /usr/libexec/platform-python $* - echo "'$*' exited with code $?" - cd - + retcode=$? + echo "'$*' exited with code $retcode" + cd - > /dev/null + return $retcode } diff --git a/confluent_osdeploy/rhvh4/profiles/default/scripts/functions b/confluent_osdeploy/rhvh4/profiles/default/scripts/functions index 0f315999..5d6189e6 100644 --- a/confluent_osdeploy/rhvh4/profiles/default/scripts/functions +++ b/confluent_osdeploy/rhvh4/profiles/default/scripts/functions @@ -3,8 +3,11 @@ run_remote() { echo echo '---------------------------------------------------------------------------' echo Running $requestedcmd from https://$mgr/confluent-public/os/$profile/scripts/ - cd $(mktemp -d) + 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 if [ -x /usr/bin/chcon ]; then @@ -12,17 +15,24 @@ run_remote() { fi shift ./$cmd $* - echo "$requestedcmd exited with code $?" - cd - + 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/ - cd $(mktemp -d) + 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 /usr/libexec/platform-python $* - echo "'$*' exited with code $?" - cd - + retcode=$? + echo "'$*' exited with code $retcode" + cd - > /dev/null + return $retcode } diff --git a/confluent_osdeploy/suse15/profiles/hpc/scripts/functions b/confluent_osdeploy/suse15/profiles/hpc/scripts/functions index 97df7cec..42e5c79a 100644 --- a/confluent_osdeploy/suse15/profiles/hpc/scripts/functions +++ b/confluent_osdeploy/suse15/profiles/hpc/scripts/functions @@ -3,23 +3,33 @@ run_remote() { echo echo '---------------------------------------------------------------------------' echo Running $requestedcmd from https://$mgr/confluent-public/os/$profile/scripts/ - cd $(mktemp -d) + 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 $* - echo "$requestedcmd exited with code $?" - cd - + 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/ - cd $(mktemp -d) + 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 $* - echo "'$*' exited with code $?" - cd - + retcode=$? + echo "'$*' exited with code $retcode" + cd - > /dev/null + return $retcode }