diff --git a/api/Jenkinsfile.ble_test b/api/Jenkinsfile.ble_test index 29f9a56..52594da 100644 --- a/api/Jenkinsfile.ble_test +++ b/api/Jenkinsfile.ble_test @@ -139,14 +139,22 @@ pipeline { sshagent([env.SSH_CREDENTIALS_ID]) { sh """ ssh -q -o StrictHostKeyChecking=no root@${params.host_ip} -o ServerAliveInterval=60 -o ServerAliveCountMax=120 << EOF - echo ==MC== Test complete, cleaning up Screen sessions - screen -wipe + echo ==MC== Test complete, cleaning up Screen sessions + screen -wipe if screen -list | grep -q ${env.TEST_HASH}; then screen -S ble_test_watchdog_${env.TEST_HASH} -X quit screen -S ble_test_${env.TEST_HASH} -X quit fi - rm /tmp/ble_test_${env.TEST_HASH}.log - rm /root/.hushlogin + if [ -f /tmp/ble_test_${env.TEST_HASH}.log ]; then + echo ==MC== Removing test log + rm /tmp/ble_test_${env.TEST_HASH}.log + fi + + if [ -f /root/.hushlogin ]; then + echo ==MC== Re-enabling MOTD + rm /root/.hushlogin + fi + """ } }