mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-09-26 20:31:11 +08:00
Use official python as base and add tini
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
#!/command/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Take down the S6 supervision tree when go2rtc fails
|
||||
# ==============================================================================
|
||||
# shellcheck shell=bash
|
||||
|
||||
if [[ "${1}" -ne 0 ]] && [[ "${1}" -ne 256 ]]; then
|
||||
bashio::log.warning "go2rtc crashed, halting add-on"
|
||||
/run/s6/basedir/bin/halt
|
||||
fi
|
||||
|
||||
bashio::log.info "go2rtc stopped, restarting..."
|
@@ -1,23 +0,0 @@
|
||||
#!/command/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Runs go2rtc
|
||||
# ==============================================================================
|
||||
# shellcheck shell=bash
|
||||
|
||||
bashio::log.info 'Starting go2rtc...'
|
||||
|
||||
declare config_path
|
||||
declare binary_path
|
||||
|
||||
config_path="/config"
|
||||
|
||||
binary_path="/usr/local/bin/go2rtc"
|
||||
if [[ -x "${config_path}/go2rtc" ]]; then
|
||||
binary_path="${config_path}/go2rtc"
|
||||
bashio::log.warning "Using go2rtc binary from '${binary_path}'"
|
||||
fi
|
||||
|
||||
# set cwd for go2rtc (for config file, Hass integration, etc)
|
||||
cd "${config_path}" || bashio::exit.nok "Could not change working directory"
|
||||
|
||||
exec "${binary_path}"
|
20
docker/run.sh
Executable file
20
docker/run.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# ==============================================================================
|
||||
# Runs go2rtc
|
||||
# ==============================================================================
|
||||
|
||||
echo 'Starting go2rtc...' >&2
|
||||
|
||||
readonly config_path="/config"
|
||||
|
||||
if [[ -x "${config_path}/go2rtc" ]]; then
|
||||
readonly binary_path="${config_path}/go2rtc"
|
||||
echo "Using go2rtc binary from '${binary_path}' instead of the embedded one" >&2
|
||||
else
|
||||
readonly binary_path="/usr/local/bin/go2rtc"
|
||||
fi
|
||||
|
||||
# set cwd for go2rtc (for config file, Hass integration, etc)
|
||||
cd "${config_path}" || echo "Could not change working directory to '${config_path}'" >&2
|
||||
|
||||
exec "${binary_path}"
|
Reference in New Issue
Block a user