@fjunier So i suspect the original script you had:
#!/bin/bash
sudo apt install geany
Was either the incorrect command (most times apt and apt-get are not the same things)
and/or it was waiting for confirmation from the end user.
I don’t know why it would run successfully when you ran the script locally, but maybe you would just “confirm” if it was requesting?
The methods I added :&& exit 0 || exit 1
were to ensure if the command completed successfully (the && part) to return with a code of 0 explicitely, while if the command failed, return with an exit code of 1 explicitely.
Hopefully this works properly for you.
The other pieces added after replacing apt with apt-get, was -y (confirm) and --force-yes (if interaction needed to confirm as well beyond the base install confirmation)
So should be more consistent.