Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example with multiple processes #14

Merged
merged 5 commits into from
Aug 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ RUN apk add --no-cache \
coreutils=8.31-r0 \
wget=1.20.3-r0

# Scrip to run after startup
CMD ["/usr/bin/run.sh"]

# Build arguments
ARG BUILD_ARCH
ARG BUILD_DATE
Expand Down
8 changes: 8 additions & 0 deletions example/rootfs/etc/services.d/example1/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Community Hass.io Add-ons: Example
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }

s6-svscanctl -t /var/run/s6/services
10 changes: 10 additions & 0 deletions example/rootfs/etc/services.d/example1/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: Example
# Runs example1 script
# ==============================================================================


bashio::log.info "Starting Example1..."

exec /usr/bin/example1.sh
8 changes: 8 additions & 0 deletions example/rootfs/etc/services.d/example2/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Community Hass.io Add-ons: Example
# ==============================================================================
if -n { s6-test $# -ne 0 }
if -n { s6-test ${1} -eq 256 }

s6-svscanctl -t /var/run/s6/services
10 changes: 10 additions & 0 deletions example/rootfs/etc/services.d/example2/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: Example
# Runs example2 script
# ==============================================================================


bashio::log.info "Starting Example2..."

exec /usr/bin/example2.sh
File renamed without changes.
17 changes: 17 additions & 0 deletions example/rootfs/usr/bin/example2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
#
# Community Hass.io Add-ons: Example
#
# Example add-on for Hass.io.
#
# ------------------------------------------------------------------------------
main() {
bashio::log.trace "${FUNCNAME[0]}"

while true; do
echo "Second Script Output"
sleep 10
done
}
main "$@"