There shouldn't be too much difference. It's actually a good exercise to run it by ChatGPT. I tried it and it did a good job. Will have to be tested of course.
Here's a prompt to try:
convert this shell script from ubuntu to amazon linux. Give me the final result with no explanations. Don't try to improve the script