Created
December 6, 2019 19:38
-
-
Save jeancsanchez/01896cf526013a72848d6c269c3f3397 to your computer and use it in GitHub Desktop.
Exemplo de script de inicialização do sistema Debian.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: start_apis | |
# Required-Start: $all | |
# Required-Stop: | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: | |
# Short-Description: Start das apis | |
# Description: Blah | |
### END INIT INFO | |
case "$1" in | |
start) | |
echo "Inicializando últimos containers ativos..." | |
containers=$(cat /root/deploy/apis) | |
docker start $containers | |
;; | |
stop) | |
echo "By containers :(" | |
;; | |
*) | |
echo "Usage: /etc/init.d/start_apis {start}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Colocar esse arquivo no diretório /etc/init.d/
chmod 755 /etc/init.d/meuscript
Sudo update-rc.d meuscript defaults
Sudo update-rc.d meuscript enable