The following changes were made by the replace_file_content tool to: /root/aadharbot/start.sh. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -1,5 +1,14 @@ #!/bin/bash -pm2 start index.js --name "aadharbot" +DIR="$(cd "$(dirname "$0")" && pwd)" +cd "$DIR" + +pm2 describe aadharbot > /dev/null 2>&1 +if [ $? -eq 0 ]; then + pm2 restart aadharbot +else + pm2 start index.js --name "aadharbot" +fi + pm2 save pm2 status [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.