mirror of
https://github.com/linuxserver/docker-homeassistant.git
synced 2026-02-20 08:40:45 +08:00
update formatting
This commit is contained in:
parent
f93fb6b6a9
commit
25dee53a44
172
Dockerfile
172
Dockerfile
@ -9,98 +9,100 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
|
||||
LABEL maintainer="saarg, roxedus"
|
||||
|
||||
# environment settings
|
||||
ENV PIPFLAGS="--no-cache-dir --use-deprecated=legacy-resolver --find-links https://wheel-index.linuxserver.io/alpine/ --find-links https://wheel-index.linuxserver.io/homeassistant/" PYTHONPATH="${PYTHONPATH}:/pip-packages"
|
||||
ENV \
|
||||
PIPFLAGS="--no-cache-dir --use-deprecated=legacy-resolver --find-links https://wheel-index.linuxserver.io/alpine/ --find-links https://wheel-index.linuxserver.io/homeassistant/" \
|
||||
PYTHONPATH="${PYTHONPATH}:/pip-packages"
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
# https://github.com/home-assistant/core/pull/43771
|
||||
#https://github.com/home-assistant/core/pull/59769
|
||||
|
||||
# install packages
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
autoconf \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
cmake \
|
||||
eudev-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
g++ \
|
||||
jq \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
make \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
unixodbc-dev \
|
||||
unzip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apk add --no-cache \
|
||||
bluez-deprecated \
|
||||
curl \
|
||||
eudev-libs \
|
||||
ffmpeg \
|
||||
iputils \
|
||||
libcap \
|
||||
libjpeg-turbo \
|
||||
libstdc++ \
|
||||
libxslt \
|
||||
mariadb-connector-c \
|
||||
mariadb-connector-c-dev \
|
||||
openssh-client \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
py3-pip \
|
||||
python3 \
|
||||
tiff && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
mkdir -p \
|
||||
/tmp/core && \
|
||||
if [ -z ${HASS_RELEASE+x} ]; then \
|
||||
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
|
||||
| jq -r .tag_name); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/core.tar.gz -L \
|
||||
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/core.tar.gz -C \
|
||||
/tmp/core --strip-components=1 && \
|
||||
HASS_BASE=$(cat /tmp/core/build.yaml \
|
||||
| grep 'amd64: ' \
|
||||
| cut -d: -f3) && \
|
||||
mkdir -p /pip-packages && \
|
||||
pip install --target /pip-packages --no-cache-dir --upgrade \
|
||||
distlib && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
cython \
|
||||
"pip>=21.0,<22.1" \
|
||||
setuptools \
|
||||
wheel && \
|
||||
cd /tmp/core && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r requirements_all.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
pip install ${PIPFLAGS} \
|
||||
PySwitchbot && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
for cleanfiles in *.pyc *.pyo; \
|
||||
do \
|
||||
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
|
||||
; done && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
autoconf \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
cmake \
|
||||
eudev-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
g++ \
|
||||
jq \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
make \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
unixodbc-dev \
|
||||
unzip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apk add --no-cache \
|
||||
bluez-deprecated \
|
||||
curl \
|
||||
eudev-libs \
|
||||
ffmpeg \
|
||||
iputils \
|
||||
libcap \
|
||||
libjpeg-turbo \
|
||||
libstdc++ \
|
||||
libxslt \
|
||||
mariadb-connector-c \
|
||||
mariadb-connector-c-dev \
|
||||
openssh-client \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
py3-pip \
|
||||
python3 \
|
||||
tiff && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
mkdir -p \
|
||||
/tmp/core && \
|
||||
if [ -z ${HASS_RELEASE+x} ]; then \
|
||||
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
|
||||
| jq -r .tag_name); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/core.tar.gz -L \
|
||||
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/core.tar.gz -C \
|
||||
/tmp/core --strip-components=1 && \
|
||||
HASS_BASE=$(cat /tmp/core/build.yaml \
|
||||
| grep 'amd64: ' \
|
||||
| cut -d: -f3) && \
|
||||
mkdir -p /pip-packages && \
|
||||
pip install --target /pip-packages --no-cache-dir --upgrade \
|
||||
distlib && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
cython \
|
||||
"pip>=21.0,<22.1" \
|
||||
setuptools \
|
||||
wheel && \
|
||||
cd /tmp/core && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r requirements_all.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
pip install ${PIPFLAGS} \
|
||||
PySwitchbot && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
for cleanfiles in *.pyc *.pyo; \
|
||||
do \
|
||||
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
|
||||
; done && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
|
||||
# environment settings. used so pip packages installed by home assistant installs in /config
|
||||
ENV HOME="/config"
|
||||
|
||||
@ -9,97 +9,99 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
|
||||
LABEL maintainer="saarg, roxedus"
|
||||
|
||||
# environment settings
|
||||
ENV PIPFLAGS="--no-cache-dir --use-deprecated=legacy-resolver --find-links https://wheel-index.linuxserver.io/alpine/ --find-links https://wheel-index.linuxserver.io/homeassistant/" PYTHONPATH="${PYTHONPATH}:/pip-packages"
|
||||
ENV \
|
||||
PIPFLAGS="--no-cache-dir --use-deprecated=legacy-resolver --find-links https://wheel-index.linuxserver.io/alpine/ --find-links https://wheel-index.linuxserver.io/homeassistant/" \
|
||||
PYTHONPATH="${PYTHONPATH}:/pip-packages"
|
||||
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
# https://github.com/home-assistant/core/pull/43771
|
||||
#https://github.com/home-assistant/core/pull/59769
|
||||
|
||||
# install packages
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
autoconf \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
cmake \
|
||||
eudev-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
g++ \
|
||||
jq \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
make \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
unixodbc-dev \
|
||||
unzip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apk add --no-cache \
|
||||
bluez-deprecated \
|
||||
curl \
|
||||
eudev-libs \
|
||||
ffmpeg \
|
||||
iputils \
|
||||
libcap \
|
||||
libjpeg-turbo \
|
||||
libstdc++ \
|
||||
libxslt \
|
||||
mariadb-connector-c \
|
||||
mariadb-connector-c-dev \
|
||||
openssh-client \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
py3-pip \
|
||||
python3 \
|
||||
tiff && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
mkdir -p \
|
||||
/tmp/core && \
|
||||
if [ -z ${HASS_RELEASE+x} ]; then \
|
||||
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
|
||||
| jq -r .tag_name); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/core.tar.gz -L \
|
||||
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/core.tar.gz -C \
|
||||
/tmp/core --strip-components=1 && \
|
||||
HASS_BASE=$(cat /tmp/core/build.yaml \
|
||||
| grep 'amd64: ' \
|
||||
| cut -d: -f3) && \
|
||||
pip install --target /pip-packages --no-cache-dir --upgrade \
|
||||
distlib && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
cython \
|
||||
"pip>=21.0,<22.1" \
|
||||
setuptools \
|
||||
wheel && \
|
||||
cd /tmp/core && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r requirements_all.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
pip install ${PIPFLAGS} \
|
||||
PySwitchbot && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
for cleanfiles in *.pyc *.pyo; \
|
||||
do \
|
||||
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
|
||||
; done && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
autoconf \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
cmake \
|
||||
eudev-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
g++ \
|
||||
jq \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
make \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
unixodbc-dev \
|
||||
unzip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apk add --no-cache \
|
||||
bluez-deprecated \
|
||||
curl \
|
||||
eudev-libs \
|
||||
ffmpeg \
|
||||
iputils \
|
||||
libcap \
|
||||
libjpeg-turbo \
|
||||
libstdc++ \
|
||||
libxslt \
|
||||
mariadb-connector-c \
|
||||
mariadb-connector-c-dev \
|
||||
openssh-client \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
py3-pip \
|
||||
python3 \
|
||||
tiff && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
mkdir -p \
|
||||
/tmp/core && \
|
||||
if [ -z ${HASS_RELEASE+x} ]; then \
|
||||
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
|
||||
| jq -r .tag_name); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/core.tar.gz -L \
|
||||
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/core.tar.gz -C \
|
||||
/tmp/core --strip-components=1 && \
|
||||
HASS_BASE=$(cat /tmp/core/build.yaml \
|
||||
| grep 'amd64: ' \
|
||||
| cut -d: -f3) && \
|
||||
pip install --target /pip-packages --no-cache-dir --upgrade \
|
||||
distlib && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
cython \
|
||||
"pip>=21.0,<22.1" \
|
||||
setuptools \
|
||||
wheel && \
|
||||
cd /tmp/core && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r requirements_all.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
pip install ${PIPFLAGS} \
|
||||
PySwitchbot && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
for cleanfiles in *.pyc *.pyo; \
|
||||
do \
|
||||
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
|
||||
; done && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
|
||||
# environment settings. used so pip packages installed by home assistant installs in /config
|
||||
ENV HOME="/config"
|
||||
|
||||
170
Dockerfile.armhf
170
Dockerfile.armhf
@ -9,7 +9,9 @@ LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DA
|
||||
LABEL maintainer="saarg, roxedus"
|
||||
|
||||
# environment settings
|
||||
ENV PIPFLAGS="--no-cache-dir --use-deprecated=legacy-resolver --find-links https://wheel-index.linuxserver.io/alpine/ --find-links https://wheel-index.linuxserver.io/homeassistant/" PYTHONPATH="${PYTHONPATH}:/pip-packages"
|
||||
ENV \
|
||||
PIPFLAGS="--no-cache-dir --use-deprecated=legacy-resolver --find-links https://wheel-index.linuxserver.io/alpine/ --find-links https://wheel-index.linuxserver.io/homeassistant/" \
|
||||
PYTHONPATH="${PYTHONPATH}:/pip-packages"
|
||||
|
||||
# necessary args to compile grpcio on arm32v7
|
||||
ARG GRPC_BUILD_WITH_BORING_SSL_ASM=false
|
||||
@ -20,92 +22,92 @@ ARG GRPC_PYTHON_DISABLE_LIBC_COMPATIBILITY=true
|
||||
# copy local files
|
||||
COPY root/ /
|
||||
|
||||
# https://github.com/home-assistant/core/pull/43771
|
||||
#https://github.com/home-assistant/core/pull/59769
|
||||
|
||||
# install packages
|
||||
RUN \
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
autoconf \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
cmake \
|
||||
eudev-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
g++ \
|
||||
jq \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
make \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
unixodbc-dev \
|
||||
unzip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apk add --no-cache \
|
||||
bluez-deprecated \
|
||||
curl \
|
||||
eudev-libs \
|
||||
ffmpeg \
|
||||
iputils \
|
||||
libcap \
|
||||
libjpeg-turbo \
|
||||
libstdc++ \
|
||||
libxslt \
|
||||
mariadb-connector-c \
|
||||
mariadb-connector-c-dev \
|
||||
openssh-client \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
py3-pip \
|
||||
python3 \
|
||||
tiff && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
mkdir -p \
|
||||
/tmp/core && \
|
||||
if [ -z ${HASS_RELEASE+x} ]; then \
|
||||
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
|
||||
| jq -r .tag_name); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/core.tar.gz -L \
|
||||
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/core.tar.gz -C \
|
||||
/tmp/core --strip-components=1 && \
|
||||
HASS_BASE=$(cat /tmp/core/build.yaml \
|
||||
| grep 'amd64: ' \
|
||||
| cut -d: -f3) && \
|
||||
pip install --target /pip-packages --no-cache-dir --upgrade \
|
||||
distlib && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
cython \
|
||||
"pip>=21.0,<22.1" \
|
||||
setuptools \
|
||||
wheel && \
|
||||
cd /tmp/core && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r requirements_all.txt --no-binary grpcio && \
|
||||
pip install ${PIPFLAGS} \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
pip install ${PIPFLAGS} \
|
||||
PySwitchbot && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
for cleanfiles in *.pyc *.pyo; \
|
||||
do \
|
||||
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
|
||||
; done && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
echo "**** install build packages ****" && \
|
||||
apk add --no-cache --virtual=build-dependencies \
|
||||
autoconf \
|
||||
ca-certificates \
|
||||
cargo \
|
||||
cmake \
|
||||
eudev-dev \
|
||||
ffmpeg-dev \
|
||||
gcc \
|
||||
g++ \
|
||||
jq \
|
||||
libffi-dev \
|
||||
jpeg-dev \
|
||||
libxml2-dev \
|
||||
libxslt-dev \
|
||||
make \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
unixodbc-dev \
|
||||
unzip && \
|
||||
echo "**** install runtime packages ****" && \
|
||||
apk add --no-cache \
|
||||
bluez-deprecated \
|
||||
curl \
|
||||
eudev-libs \
|
||||
ffmpeg \
|
||||
iputils \
|
||||
libcap \
|
||||
libjpeg-turbo \
|
||||
libstdc++ \
|
||||
libxslt \
|
||||
mariadb-connector-c \
|
||||
mariadb-connector-c-dev \
|
||||
openssh-client \
|
||||
openssl \
|
||||
postgresql-libs \
|
||||
py3-pip \
|
||||
python3 \
|
||||
tiff && \
|
||||
echo "**** install homeassistant ****" && \
|
||||
mkdir -p \
|
||||
/tmp/core && \
|
||||
if [ -z ${HASS_RELEASE+x} ]; then \
|
||||
HASS_RELEASE=$(curl -sX GET https://api.github.com/repos/home-assistant/core/releases/latest \
|
||||
| jq -r .tag_name); \
|
||||
fi && \
|
||||
curl -o \
|
||||
/tmp/core.tar.gz -L \
|
||||
"https://github.com/home-assistant/core/archive/${HASS_RELEASE}.tar.gz" && \
|
||||
tar xf \
|
||||
/tmp/core.tar.gz -C \
|
||||
/tmp/core --strip-components=1 && \
|
||||
HASS_BASE=$(cat /tmp/core/build.yaml \
|
||||
| grep 'amd64: ' \
|
||||
| cut -d: -f3) && \
|
||||
pip install --target /pip-packages --no-cache-dir --upgrade \
|
||||
distlib && \
|
||||
pip install --no-cache-dir --upgrade \
|
||||
cython \
|
||||
"pip>=21.0,<22.1" \
|
||||
setuptools \
|
||||
wheel && \
|
||||
cd /tmp/core && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r https://raw.githubusercontent.com/home-assistant/docker/${HASS_BASE}/requirements.txt && \
|
||||
pip install ${PIPFLAGS} \
|
||||
-r requirements_all.txt --no-binary grpcio && \
|
||||
pip install ${PIPFLAGS} \
|
||||
homeassistant==${HASS_RELEASE} && \
|
||||
pip install ${PIPFLAGS} \
|
||||
PySwitchbot && \
|
||||
echo "**** cleanup ****" && \
|
||||
apk del --purge \
|
||||
build-dependencies && \
|
||||
for cleanfiles in *.pyc *.pyo; \
|
||||
do \
|
||||
find /usr/lib/python3.* -iname "${cleanfiles}" -exec rm -f '{}' + \
|
||||
; done && \
|
||||
rm -rf \
|
||||
/tmp/* \
|
||||
/root/.cache \
|
||||
/root/.cargo
|
||||
|
||||
# environment settings. used so pip packages installed by home assistant installs in /config
|
||||
ENV HOME="/config"
|
||||
|
||||
@ -4,23 +4,23 @@ FILES=$(find /dev/ttyACM* /dev/ttyUSB* -type c -print 2>/dev/null)
|
||||
|
||||
for i in $FILES
|
||||
do
|
||||
USB_GID=$(stat -c '%g' "$i")
|
||||
if id -G abc | grep -qw "$USB_GID"; then
|
||||
touch /groupadd
|
||||
else
|
||||
if [ ! "${USB_GID}" == '0' ]; then
|
||||
USB_NAME=$(getent group "${USB_GID}" | awk -F: '{print $1}')
|
||||
if [ -z "${USB_NAME}" ]; then
|
||||
USB_NAME="usb$(head /dev/urandom | tr -dc 'a-z0-9' | head -c8)"
|
||||
groupadd "$USB_NAME"
|
||||
groupmod -g "$USB_GID" "$USB_NAME"
|
||||
fi
|
||||
usermod -a -G "$USB_NAME" abc
|
||||
touch /groupadd
|
||||
fi
|
||||
USB_GID=$(stat -c '%g' "$i")
|
||||
if id -G abc | grep -qw "$USB_GID"; then
|
||||
touch /groupadd
|
||||
else
|
||||
if [ ! "${USB_GID}" == '0' ]; then
|
||||
USB_NAME=$(getent group "${USB_GID}" | awk -F: '{print $1}')
|
||||
if [ -z "${USB_NAME}" ]; then
|
||||
USB_NAME="usb$(head /dev/urandom | tr -dc 'a-z0-9' | head -c8)"
|
||||
groupadd "$USB_NAME"
|
||||
groupmod -g "$USB_GID" "$USB_NAME"
|
||||
fi
|
||||
usermod -a -G "$USB_NAME" abc
|
||||
touch /groupadd
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then
|
||||
usermod -a -G root abc
|
||||
usermod -a -G root abc
|
||||
fi
|
||||
|
||||
@ -3,5 +3,5 @@
|
||||
setcap 'cap_net_bind_service=+ep' /usr/bin/python3.9
|
||||
|
||||
exec \
|
||||
s6-setuidgid abc /usr/bin/hass \
|
||||
-c /config
|
||||
s6-setuidgid abc /usr/bin/hass \
|
||||
-c /config
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user