0

I found these 2 snippets in a docker-compose.yml that have the statement $${!}.

This will check if your certificate is up for renewal every 12 hours as recommended by Let’s Encrypt.

entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"

In the nginx section, you need to make sure that nginx reloads the newly obtained certificates:

command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"

Can anybody explain what this is?
What it means?
How it fits in this story of certificate renewal?

progonkpa
  • 3,590
  • 9
  • 31
  • 50
  • 2
    `$${!}` in docker-compose.yml becomes `${!}` in Bash: [How can I escape a $ dollar sign in a docker compose file?](https://stackoverflow.com/questions/40619582/how-can-i-escape-a-dollar-sign-in-a-docker-compose-file). – that other guy Aug 15 '21 at 21:34
  • @thatotherguy that's one piece of the puzzle, now the question remains what is the meaning of ${!} – progonkpa Aug 15 '21 at 21:47
  • [What does mean $$ or $! in bash?](https://stackoverflow.com/questions/13671750/what-does-mean-or-in-bash) – that other guy Aug 15 '21 at 21:50
  • @thatotherguy so it stands for the PID of the last program that ran in the background. Why does it have to wait in the background for the sleep to finish? Seems like you can only do sleep in the infinite while loop. – progonkpa Aug 15 '21 at 22:24

0 Answers0