16 lines
541 B
Bash
Executable File
16 lines
541 B
Bash
Executable File
#!/bin/bash -e
|
|
|
|
[ ! -f /config/custom_components ] || rm -f /config/custom_components
|
|
[ -d /config/custom_components ] || mkdir -p /config/custom_components
|
|
|
|
for component in /usr/local/config/custom_components/*; do
|
|
cb="$(basename "${component}")"
|
|
[ ! -d "/config/custom_components/${cb}" ] || rm -rf "/config/custom_components/${cb}"
|
|
if [ ! -e "/config/custom_components/${cb}" ]; then
|
|
echo "Installing custom component ${cb}"
|
|
ln -s "${component}" "/config/custom_components/${cb}"
|
|
fi
|
|
done
|
|
|
|
exec /init "$@"
|