Hi @markus !
Sorry for the last answer, I forgot that.
Well, congrats, you made your first script!
What you made with this:
It is an example of a shell script. Now, you should put this content into a file and add
#!/bin/sh. This is how it would look like.
git clone https://github.com/letsencrypt/letsencrypt
./letsencrypt-auto certonly --webroot -w /opt/bitnami/apps/mediawiki/htdocs -d DOMAIN
cp /etc/letsencrypt/live/DOMAIN/fullchain.pem /opt/bitnami/apache2/conf/server.crt
cp /etc/letsencrypt/live/DOMAIN/privkey.pem /opt/bitnami/apache2/conf/server.key
/opt/bitnami/ctlscript.sh restart apache
You can change the
/opt directory to clone the repo to
/home/your_user if you want.
Now, all you have to do it is put this content into a file and put this name:
name_of_script.sh. Put the name that you like but end it with a
Then, if you give permissions to the file with:
chmod +x name_of_script.sh
And execute it with:
You will see the same result that if you do manually.
If you want to automate this script you should do a
cron command and put
sh name_of_script.sh as the command that cron will execute.
There's a guide here about how to make your first script:
There is useful information there.
I hope this information is useful for you. If you have any other question, please do not hesitate to let us know.
Thank you and best regards,