update repository references and improve script handling
This commit is contained in:
@@ -25,4 +25,4 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mounts": [ "type=volume,target=/var/lib/docker" ]
|
"mounts": [ "type=volume,target=/var/lib/docker" ]
|
||||||
}
|
}
|
||||||
|
|||||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,2 +1,2 @@
|
|||||||
---
|
---
|
||||||
custom: https://buymeacoffee.com/mesteriisw
|
custom: https://www.buymeacoffee.com/alexbelgium
|
||||||
|
|||||||
2
.github/linters/.gitleaks.toml
vendored
2
.github/linters/.gitleaks.toml
vendored
@@ -7,4 +7,4 @@ useDefault = false
|
|||||||
|
|
||||||
[allowlist]
|
[allowlist]
|
||||||
description = "global allowlist. whitelisting paths"
|
description = "global allowlist. whitelisting paths"
|
||||||
#paths = ['''/github/workspace/epicgamesfree/templates/config.json''']
|
paths = ['''/github/workspace/epicgamesfree/templates/config.json''']
|
||||||
|
|||||||
114
.github/paths-filter.yml
vendored
114
.github/paths-filter.yml
vendored
@@ -1,4 +1,118 @@
|
|||||||
# AUTO BUILDS #
|
# AUTO BUILDS #
|
||||||
# From https://github.com/Poeschl/Hassio-Addons
|
# From https://github.com/Poeschl/Hassio-Addons
|
||||||
# name: slug/filename ; could be slug/config.* for all files
|
# name: slug/filename ; could be slug/config.* for all files
|
||||||
|
addons_updater: addons_updater/config.* # Image : yes
|
||||||
|
arpspoof: arpspoof/config.* # Image : yes
|
||||||
|
autobrr: autobrr/config.* # Image : yes
|
||||||
|
baikal: baikal/config.* # Image : yes
|
||||||
|
battybirdnet-pi: battybirdnet-pi/config.* # Image : yes
|
||||||
|
bazarr: bazarr/config.* # Image : yes
|
||||||
|
binance-trading-bot: binance-trading-bot/config.* # Image : yes
|
||||||
|
birdnet-go: birdnet-go/config.* # Image : yes
|
||||||
|
birdnet-pi: birdnet-pi/config.* # Image : yes
|
||||||
|
bitwarden: bitwarden/config.* # Image : yes
|
||||||
|
booksonic_air: booksonic_air/config.* # Image : yes
|
||||||
|
browserless_chrome: browserless_chrome/config.* # Image : yes
|
||||||
|
calibre: calibre/config.* # Image : yes
|
||||||
|
calibre_web: calibre_web/config.* # Image : yes
|
||||||
|
changedetection.io: changedetection.io/config.* # Image : yes
|
||||||
|
cloudcommander: cloudcommander/config.* # Image : yes
|
||||||
|
code-server: code-server/config.* # Image : yes
|
||||||
|
codex: codex/config.* # Image : yes
|
||||||
|
comixed: comixed/config.* # Image : yes
|
||||||
|
elasticsearch: elasticsearch/config.* # Image : yes
|
||||||
|
emby: emby/config.* # Image : yes
|
||||||
|
enedisgateway2mqtt: enedisgateway2mqtt/config.* # Image : yes
|
||||||
|
enedisgateway2mqtt_dev: enedisgateway2mqtt_dev/config.* # Image : yes
|
||||||
|
epicgamesfree: epicgamesfree/config.* # Image : yes
|
||||||
|
filebrowser: filebrowser/config.* # Image : yes
|
||||||
|
fireflyiii: fireflyiii/config.* # Image : yes
|
||||||
|
fireflyiii_data_importer: fireflyiii_data_importer/config.* # Image : yes
|
||||||
|
fireflyiii_fints_importer: fireflyiii_fints_importer/config.* # Image : yes
|
||||||
|
flaresolverr: flaresolverr/config.* # Image : yes
|
||||||
|
flexget: flexget/config.* # Image : yes
|
||||||
|
free_games_claimer: free_games_claimer/config.* # Image : yes
|
||||||
|
gazpar2mqtt: gazpar2mqtt/config.* # Image : yes
|
||||||
gitea: gitea/config.* # Image : yes
|
gitea: gitea/config.* # Image : yes
|
||||||
|
grampsweb: grampsweb/config.* # Image : yes
|
||||||
|
grav: grav/config.* # Image : yes
|
||||||
|
guacamole: guacamole/config.* # Image : yes
|
||||||
|
immich: immich/config.* # Image : yes
|
||||||
|
immich_cuda: immich_cuda/config.* # Image : yes
|
||||||
|
immich_openvino: immich_openvino/config.* # Image : yes
|
||||||
|
immich_power_tools: immich_power_tools/config.* # Image : yes
|
||||||
|
inadyn: inadyn/config.* # Image : yes
|
||||||
|
jackett: jackett/config.* # Image : yes
|
||||||
|
jellyfin: jellyfin/config.* # Image : yes
|
||||||
|
jellyseerr: jellyseerr/config.* # Image : yes
|
||||||
|
joal: joal/config.* # Image : yes
|
||||||
|
joplin: joplin/config.* # Image : yes
|
||||||
|
kometa: kometa/config.* # Image : yes
|
||||||
|
lidarr: lidarr/config.* # Image : yes
|
||||||
|
linkwarden: linkwarden/config.* # Image : yes
|
||||||
|
mealie: mealie/config.* # Image : yes
|
||||||
|
mealie_api: mealie_api/config.* # Image : yes
|
||||||
|
mealie_frontend: mealie_frontend/config.* # IImage : yes # Image : yes
|
||||||
|
monica: monica/config.* # Image : yes
|
||||||
|
myelectricaldata: myelectricaldata/config.* # Image : yes
|
||||||
|
myelectricaldata_dev: myelectricaldata_dev/config.* # Image : yes
|
||||||
|
mylar3: mylar3/config.* # Image : yes
|
||||||
|
navidrome: navidrome/config.* # Image : yes
|
||||||
|
netalertx: netalertx/config.* # Image : yes
|
||||||
|
nextcloud: nextcloud/config.* # Image : yes
|
||||||
|
nzbget: nzbget/config.* # Image : yes
|
||||||
|
omada: omada/config.* # Image : yes
|
||||||
|
omada_v3: omada_v3/config.* # Image : yes
|
||||||
|
ombi: ombi/config.* # Image : yes
|
||||||
|
openproject: openproject/config.* # Image : yes
|
||||||
|
organizr: organizr/config.* # Image : yes
|
||||||
|
overleaf: overleaf/config.* # Image : yes
|
||||||
|
overseerr: overseerr/config.* # Image : yes
|
||||||
|
paperless_ngx: paperless_ngx/config.* # Image : yes
|
||||||
|
papermerge: papermerge/config.* # Image : yes
|
||||||
|
photoprism: photoprism/config.* # Image : yes
|
||||||
|
piwigo: piwigo/config.* # Image : yes
|
||||||
|
plex: plex/config.* # Image : yes
|
||||||
|
portainer: portainer/config.* # Image : yes
|
||||||
|
portainer_agent: portainer_agent/config.* # Image : yes
|
||||||
|
postgres: postgres/config.* # Image : yes
|
||||||
|
prowlarr: prowlarr/config.* # Image : yes
|
||||||
|
qbittorrent: qbittorrent/config.* # Image : yes
|
||||||
|
radarr: radarr/config.* # Image : yes
|
||||||
|
readarr: readarr/config.* # Image : yes
|
||||||
|
requestrr: requestrr/config.* # Image : yes
|
||||||
|
resiliosync: resiliosync/config.* # Image : yes
|
||||||
|
sabnzb: sabnzb/config.* # Image : yes
|
||||||
|
sabnzbd: sabnzbd/config.* # Image : yes
|
||||||
|
scrutiny: scrutiny/config.* # Image : yes
|
||||||
|
scrutiny_fa: scrutiny_fa/config.* # Image : yes
|
||||||
|
seafile: seafile/config.* # Image : yes
|
||||||
|
signalk: signalk/config.* # Image : yes
|
||||||
|
socks5-proxy: socks5-proxy/config.* # Image : yes
|
||||||
|
sonarr: sonarr/config.* # Image : yes
|
||||||
|
sponsorblockcast: sponsorblockcast/config.* # Image : yes
|
||||||
|
spotweb: spotweb/config.* # Image : yes
|
||||||
|
tandoor_recipes: tandoor_recipes/config.* # Image : yes
|
||||||
|
tdarr: tdarr/config.* # Image : yes
|
||||||
|
teamspeak: teamspeak/config.* # Image : yes
|
||||||
|
tor: tor/config.* # Image : yes
|
||||||
|
transmission: transmission/config.* # Image : yes
|
||||||
|
transmission_openvpn: transmission_openvpn/config.* # Image : yes
|
||||||
|
ubooquity: ubooquity/config.* # Image : yes
|
||||||
|
unpackerr: unpackerr/config.* # Image : yes
|
||||||
|
vaultwarden: vaultwarden/config.* # Image : yes
|
||||||
|
webtop: webtop/config.* # Image : yes
|
||||||
|
webtop_kde: webtop_kde/config.* # Image : yes
|
||||||
|
webtrees: webtrees/config.* # Image : yes
|
||||||
|
wger: wger/config.* # Image : yes
|
||||||
|
whatsapper: whatsapper/config.* # Image : yes
|
||||||
|
whoogle: whoogle/config.* # Image : yes
|
||||||
|
xteve: xteve/config.* # Image : yes
|
||||||
|
zoneminder: zoneminder/config.* # Image : yes
|
||||||
|
zzz_archived_bitwarden: zzz_archived_bitwarden/config.* # Image : yes
|
||||||
|
zzz_archived_code-server: zzz_archived_code-server/config.* # Image : yes
|
||||||
|
zzz_archived_paperless_ngx: zzz_archived_paperless_ngx/config.* # Image : yes
|
||||||
|
zzz_archived_plex_meta_manager: zzz_archived_plex_meta_manager/config.* # Image : yes
|
||||||
|
zzz_draft_birdnet-pi: zzz_draft_birdnet-pi/config.* # Image : yes
|
||||||
|
zzz_draft_overleaf: zzz_draft_overleaf/config.* # Image : yes
|
||||||
|
zzz_test: zzz_test/config.* # Image : yes
|
||||||
|
|||||||
719
.github/stars.svg
vendored
Normal file
719
.github/stars.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 337 KiB |
0
.github/stars2.svg
vendored
Normal file
0
.github/stars2.svg
vendored
Normal file
1
.github/starsevol.svg
vendored
Normal file
1
.github/starsevol.svg
vendored
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 112 KiB |
BIN
.github/stats.png
vendored
Normal file
BIN
.github/stats.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
BIN
.github/stats_addons.png
vendored
Normal file
BIN
.github/stats_addons.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
30
.github/workflows/archived_lint-checks.yaml
vendored
30
.github/workflows/archived_lint-checks.yaml
vendored
@@ -3,9 +3,9 @@ name: Lint / Syntax checks
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [master]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
hadolint:
|
hadolint:
|
||||||
@@ -50,16 +50,16 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# markdownlint:
|
markdownlint:
|
||||||
# runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# steps:
|
steps:
|
||||||
# - name: ↩️ Checkout
|
- name: ↩️ Checkout
|
||||||
# uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
# with:
|
with:
|
||||||
# # Full git history is needed to get a proper list of changed files within `super-linter`
|
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||||
# fetch-depth: 0
|
fetch-depth: 0
|
||||||
#
|
|
||||||
# - name: 🔎 Run markdownlint
|
- name: 🔎 Run markdownlint
|
||||||
# uses: nosborn/github-action-markdown-cli@v3.3.0
|
uses: nosborn/github-action-markdown-cli@v3.3.0
|
||||||
# with:
|
with:
|
||||||
# config_file: .markdownlint.yaml
|
config_file: .markdownlint.yaml
|
||||||
|
|||||||
1
.github/workflows/daily_README.yaml
vendored
1
.github/workflows/daily_README.yaml
vendored
@@ -7,6 +7,7 @@ on:
|
|||||||
workflow_dispatch: null
|
workflow_dispatch: null
|
||||||
jobs:
|
jobs:
|
||||||
README_updater:
|
README_updater:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
|
|||||||
4
.github/workflows/daily_stale.yml
vendored
4
.github/workflows/daily_stale.yml
vendored
@@ -9,7 +9,7 @@ name: Mark stale issues and pull requests
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 12 * * *'
|
- cron: '0 12 * * 0'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
pull-requests: write
|
pull-requests: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v9.0.0
|
- uses: actions/stale@v8
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
stale-issue-message: 'This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.'
|
||||||
|
|||||||
7
.github/workflows/helper_stats_graphs.yaml
vendored
7
.github/workflows/helper_stats_graphs.yaml
vendored
@@ -7,6 +7,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stats_graphs:
|
stats_graphs:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
@@ -230,11 +231,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Starting run"
|
echo "Starting run"
|
||||||
# Get stars
|
# Get stars
|
||||||
wget -S -O .github/stars.svg https://contrib.rocks/image?repo=Mesteriis/hassio-addons-avm || true
|
wget -S -O .github/stars.svg https://contrib.rocks/image?repo=alexbelgium/hassio-addons || true
|
||||||
# Get stars2
|
# Get stars2
|
||||||
wget -S -O .github/stars2.svg https://git-lister.onrender.com/api/stars/Mesteriis/hassio-addons-avm?limit=30 || true
|
wget -S -O .github/stars2.svg https://git-lister.onrender.com/api/stars/alexbelgium/hassio-addons?limit=30 || true
|
||||||
# Get stars evolution
|
# Get stars evolution
|
||||||
wget -S -O .github/starsevol.svg "https://api.star-history.com/svg?repos=Mesteriis/hassio-addons-avm&type=Date" || true
|
wget -S -O .github/starsevol.svg "https://api.star-history.com/svg?repos=alexbelgium/hassio-addons&type=Date" || true
|
||||||
- name: Commit if needed
|
- name: Commit if needed
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/on_issues.yml
vendored
2
.github/workflows/on_issues.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
echo "Starting"
|
echo "Starting"
|
||||||
|
|
||||||
# Get issues list
|
# Get issues list
|
||||||
curl -s -L https://api.github.com/repos/Mesteriis/hassio-addons-avm/issues > issueslist
|
curl -s -L https://api.github.com/repos/alexbelgium/hassio-addons/issues > issueslist
|
||||||
# Go through all folders, add to filters if not existing
|
# Go through all folders, add to filters if not existing
|
||||||
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
for f in $( find -- * -maxdepth 0 -type d | sort -r ); do
|
||||||
if [ -f "$f"/config.json ]; then
|
if [ -f "$f"/config.json ]; then
|
||||||
|
|||||||
40
.github/workflows/onpr_automerge.old
vendored
Normal file
40
.github/workflows/onpr_automerge.old
vendored
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# yamllint disable rule:line-length
|
||||||
|
# shellcheck disable=SC2043
|
||||||
|
---
|
||||||
|
name: automerge
|
||||||
|
on:
|
||||||
|
pull_request_review:
|
||||||
|
types:
|
||||||
|
- submitted
|
||||||
|
issue_comment:
|
||||||
|
types: created
|
||||||
|
check_suite:
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
status: {}
|
||||||
|
jobs:
|
||||||
|
labeler:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Add the automerge label
|
||||||
|
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/automerge') }}
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
with:
|
||||||
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
script: |
|
||||||
|
github.issues.addLabels({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
labels: ['automerge']
|
||||||
|
})
|
||||||
|
automerge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [labeler]
|
||||||
|
steps:
|
||||||
|
- id: automerge
|
||||||
|
if: ${{ github.event.issue.pull_request }}
|
||||||
|
name: automerge
|
||||||
|
uses: "pascalgn/automerge-action@v0.16.2"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||||
17
.github/workflows/onpush_builder.yaml
vendored
17
.github/workflows/onpush_builder.yaml
vendored
@@ -16,6 +16,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
correct_path_filters:
|
correct_path_filters:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: ↩️ Checkout
|
- name: ↩️ Checkout
|
||||||
@@ -128,6 +129,20 @@ jobs:
|
|||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Resolve Symlinks
|
||||||
|
run: |
|
||||||
|
# Find all symlinks and replace them with the real files or directories
|
||||||
|
find . -type l | while read -r link; do
|
||||||
|
target="$(readlink -f "$link")"
|
||||||
|
# Remove the symlink
|
||||||
|
rm "$link"
|
||||||
|
if [ -d "$target" ]; then
|
||||||
|
cp -R "$target" "$link"
|
||||||
|
else
|
||||||
|
cp "$target" "$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Get information
|
- name: Get information
|
||||||
id: info
|
id: info
|
||||||
uses: home-assistant/actions/helpers/info@master
|
uses: home-assistant/actions/helpers/info@master
|
||||||
@@ -169,7 +184,7 @@ jobs:
|
|||||||
- name: Build ${{ matrix.addon }} add-on
|
- name: Build ${{ matrix.addon }} add-on
|
||||||
id: builderstep
|
id: builderstep
|
||||||
if: steps.check.outputs.build_arch == 'true'
|
if: steps.check.outputs.build_arch == 'true'
|
||||||
uses: home-assistant/builder@master
|
uses: home-assistant/builder@2025.02.0
|
||||||
env:
|
env:
|
||||||
CAS_API_KEY: ${{ secrets.CAS_API_KEY }}
|
CAS_API_KEY: ${{ secrets.CAS_API_KEY }}
|
||||||
with:
|
with:
|
||||||
|
|||||||
5
.github/workflows/onpush_superlinter.yml
vendored
5
.github/workflows/onpush_superlinter.yml
vendored
@@ -9,9 +9,9 @@ name: Lint On Change
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [ master ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [ master ]
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
run-lint:
|
run-lint:
|
||||||
@@ -20,6 +20,7 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
# Full git history is needed to get a proper list of changed files within `super-linter`
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Lint Code Base
|
- name: Lint Code Base
|
||||||
|
|||||||
2
.github/workflows/weekly-supelinter.yaml
vendored
2
.github/workflows/weekly-supelinter.yaml
vendored
@@ -14,6 +14,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
make-executable:
|
make-executable:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
@@ -63,6 +64,7 @@ jobs:
|
|||||||
|
|
||||||
check_crlf:
|
check_crlf:
|
||||||
name: Check CRLF action
|
name: Check CRLF action
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
8
.github/workflows/weekly_addons_updater
vendored
8
.github/workflows/weekly_addons_updater
vendored
@@ -27,10 +27,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p /data
|
mkdir -p /data
|
||||||
echo "{" >> /data/config.json
|
echo "{" >> /data/config.json
|
||||||
echo " repository=\"Mesteriis/hassio-addons-avm\"," >> /data/config.json
|
echo " repository=\"alexbelgium/hassio-addons\"," >> /data/config.json
|
||||||
echo " gituser=\"Mesteriis/hassio-addons-avm\"," >> /data/config.json
|
echo " gituser=\"alexbelgium/hassio-addons\"," >> /data/config.json
|
||||||
echo " gitapi=\"Mesteriis/hassio-addons-avm\"," >> /data/config.json
|
echo " gitapi=\"alexbelgium/hassio-addons\"," >> /data/config.json
|
||||||
echo " gitmail=\"Mesteriis/hassio-addons-avm\"," >> /data/config.json
|
echo " gitmail=\"alexbelgium/hassio-addons\"," >> /data/config.json
|
||||||
echo " verbose=false" >> /data/config.json
|
echo " verbose=false" >> /data/config.json
|
||||||
echo "}" >> /data/config.json
|
echo "}" >> /data/config.json
|
||||||
./addons_updater/rootfs/etc/cont-init.d/99-run.sh
|
./addons_updater/rootfs/etc/cont-init.d/99-run.sh
|
||||||
|
|||||||
1
.github/workflows/weekly_bashbeautify.yaml
vendored
1
.github/workflows/weekly_bashbeautify.yaml
vendored
@@ -11,6 +11,7 @@ concurrency:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint-bash:
|
lint-bash:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
name: Lint Bash Scripts
|
name: Lint Bash Scripts
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/weekly_crlftolf.yaml
vendored
2
.github/workflows/weekly_crlftolf.yaml
vendored
@@ -8,6 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
crlf-to-lf:
|
crlf-to-lf:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository contents
|
- name: Checkout repository contents
|
||||||
@@ -24,6 +25,7 @@ jobs:
|
|||||||
|
|
||||||
fix-crlf:
|
fix-crlf:
|
||||||
name: Fix CRLF Endings
|
name: Fix CRLF Endings
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-latest # Use a Linux runner
|
runs-on: ubuntu-latest # Use a Linux runner
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository contents
|
- name: Checkout repository contents
|
||||||
|
|||||||
1
.github/workflows/weekly_reduceimagesize.yml
vendored
1
.github/workflows/weekly_reduceimagesize.yml
vendored
@@ -9,6 +9,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
calibre:
|
calibre:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
name: calibreapp/image-actions
|
name: calibreapp/image-actions
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
1
.github/workflows/weekly_sortjson.yaml
vendored
1
.github/workflows/weekly_sortjson.yaml
vendored
@@ -9,6 +9,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
sort_json:
|
sort_json:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
|
|||||||
13
.github/workflows/weekly_stats.yaml
vendored
13
.github/workflows/weekly_stats.yaml
vendored
@@ -8,6 +8,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
stats_updater:
|
stats_updater:
|
||||||
|
if: github.repository_owner == 'alexbelgium'
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
@@ -38,22 +39,22 @@ jobs:
|
|||||||
if [ -f "$f"/config.json ] && jq -e '.image' "$f/config.json"; then
|
if [ -f "$f"/config.json ] && jq -e '.image' "$f/config.json"; then
|
||||||
SLUG="$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')"
|
SLUG="$(jq -r '.image' "$f/config.json" | awk -F 'alexbelgium/|-{arch' '{print $2}')"
|
||||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"armv7"* ]]; then
|
if [[ "$(jq '.arch[]' "$f/config.json")" == *"armv7"* ]]; then
|
||||||
ARCH=armv7 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/Mesteriis/hassio-addons-avm/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
ARCH=armv7 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||||
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/Mesteriis/hassio-addons-avm/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
|
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
|
||||||
COUNT="${COUNT//,/}"
|
COUNT="${COUNT//,/}"
|
||||||
COUNT1="$COUNT"
|
COUNT1="$COUNT"
|
||||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||||
else COUNT1="-"; fi
|
else COUNT1="-"; fi
|
||||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
|
if [[ "$(jq '.arch[]' "$f/config.json")" == *"amd64"* ]]; then
|
||||||
ARCH=amd64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/Mesteriis/hassio-addons-avm/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
ARCH=amd64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||||
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/Mesteriis/hassio-addons-avm/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
|
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
|
||||||
COUNT="${COUNT//,/}"
|
COUNT="${COUNT//,/}"
|
||||||
COUNT2="$COUNT"
|
COUNT2="$COUNT"
|
||||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||||
else COUNT2="-"; fi
|
else COUNT2="-"; fi
|
||||||
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
|
if [[ "$(jq '.arch[]' "$f/config.json")" == *"aarch64"* ]]; then
|
||||||
ARCH=aarch64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/Mesteriis/hassio-addons-avm/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
ARCH=aarch64 && COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')"
|
||||||
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/Mesteriis/hassio-addons-avm/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
|
until [ -n "$COUNT" ]; do COUNT="$(curl --connect-timeout 5 -f -s -L https://github.com/alexbelgium/hassio-addons/pkgs/container/$SLUG-$ARCH/latest | awk '/Total downloads/{getline; print}' | awk -F '<|>' '{print $3}')" && sleep 5; ((c++)) && echo "repeat $c" && if [[ "$c" == 10 ]]; then count=0; fi; done
|
||||||
COUNT="${COUNT//,/}"
|
COUNT="${COUNT//,/}"
|
||||||
COUNT3="$COUNT"
|
COUNT3="$COUNT"
|
||||||
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
echo "$COUNT $ARCH users with $SLUG" && DOWNLOADS="$(( DOWNLOADS + COUNT))"
|
||||||
|
|||||||
@@ -4,25 +4,25 @@
|
|||||||
|
|
||||||
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
[![Donate][donation-badge]](https://www.buymeacoffee.com/alexbelgium)
|
||||||
[![Donate][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA)
|
[![Donate][paypal-badge]](https://www.paypal.com/donate/?hosted_button_id=DZFULJZTP3UQA)
|
||||||

|

|
||||||
|
|
||||||
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20(no%20paypal)-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
|
[donation-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20(no%20paypal)-%23d32f2f?logo=buy-me-a-coffee&style=flat&logoColor=white
|
||||||
[paypal-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20with%20Paypal-0070BA?logo=paypal&style=flat&logoColor=white
|
[paypal-badge]: https://img.shields.io/badge/Buy%20me%20a%20coffee%20with%20Paypal-0070BA?logo=paypal&style=flat&logoColor=white
|
||||||
|
|
||||||
[](https://www.codacy.com/gh/Mesteriis/hassio-addons-avm/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Mesteriis/hassio-addons-avm&utm_campaign=Badge_Grade)
|
[](https://www.codacy.com/gh/alexbelgium/hassio-addons/dashboard?utm_source=github.com&utm_medium=referral&utm_content=alexbelgium/hassio-addons&utm_campaign=Badge_Grade)
|
||||||
[](https://github.com/Mesteriis/hassio-addons-avm/actions/workflows/weekly-supelinter.yaml)
|
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly-supelinter.yaml)
|
||||||
[](https://github.com/Mesteriis/hassio-addons-avm/actions/workflows/onpush_builder.yaml)
|
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/onpush_builder.yaml)
|
||||||
[](https://github.com/Mesteriis/hassio-addons-avm/actions/workflows/weekly_stats.yaml)
|
[](https://github.com/alexbelgium/hassio-addons/actions/workflows/weekly_stats.yaml)
|
||||||
|
|
||||||
[support-badge]: https://camo.githubusercontent.com/f4dbb995049f512fdc97fcc9e022ac243fa38c408510df9d46c7467d0970d959/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f72742d7468726561642d677265656e2e737667
|
[support-badge]: https://camo.githubusercontent.com/f4dbb995049f512fdc97fcc9e022ac243fa38c408510df9d46c7467d0970d959/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f537570706f72742d7468726561642d677265656e2e737667
|
||||||
|
|
||||||
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
|
_Thanks to everyone having starred my repo! To star it click on the image below, then it will be on top right. Thanks!_
|
||||||
|
|
||||||
[](https://github.com/Mesteriis/hassio-addons-avm/stargazers)
|
[](https://github.com/alexbelgium/hassio-addons/stargazers)
|
||||||
|
|
||||||
_Thanks to all contributors !_
|
_Thanks to all contributors !_
|
||||||
|
|
||||||
[](https://github.com/Mesteriis/hassio-addons-avm/graphs/contributors)
|
[](https://github.com/alexbelgium/hassio-addons/graphs/contributors)
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ home to the next level.
|
|||||||
|
|
||||||
[![Add repository on my Home Assistant][repository-badge]][repository-url]
|
[![Add repository on my Home Assistant][repository-badge]][repository-url]
|
||||||
|
|
||||||
If you want to do add the repository manually, please follow the procedure highlighted in the [Home Assistant website](https://home-assistant.io/hassio/installing_third_party_addons). Use the following URL to add this repository: https://github.com/Mesteriis/hassio-addons-avm
|
If you want to do add the repository manually, please follow the procedure highlighted in the [Home Assistant website](https://home-assistant.io/hassio/installing_third_party_addons). Use the following URL to add this repository: https://github.com/alexbelgium/hassio-addons
|
||||||
|
|
||||||
## Statistics
|
## Statistics
|
||||||
|
|
||||||
@@ -61,17 +61,15 @@ If you want to do add the repository manually, please follow the procedure highl
|
|||||||
|
|
||||||
### Total downloads evolution
|
### Total downloads evolution
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.github/stats.png" width=500px>
|
<img src="https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.github/stats.png" width=500px>
|
||||||
|
|
||||||
### Specific downloads evolution
|
### Specific downloads evolution
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.github/stats_addons.png" width=500px>
|
<img src="https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.github/stats_addons.png" width=500px>
|
||||||
|
|
||||||
### Stars evolution
|
### Stars evolution
|
||||||
|
|
||||||
<a href="https://star-history.com">
|
[](https://star-history.com/#alexbelgium/hassio-addons&Date)
|
||||||
<img src="https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.github/starsevol.svg" width=500px>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
## Add-ons provided by this repository
|
## Add-ons provided by this repository
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ if [ -e "/MODULESFILE" ]; then
|
|||||||
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi &&
|
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi &&
|
||||||
apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates >/dev/null || true &&
|
apt-get update && apt-get install -yqq --no-install-recommends ca-certificates || apk add --no-cache ca-certificates >/dev/null || true &&
|
||||||
mkdir -p /etc/cont-init.d &&
|
mkdir -p /etc/cont-init.d &&
|
||||||
for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done &&
|
for scripts in $MODULES; do echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" && [ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] || (echo "script failed to install $scripts" && exit 1); done &&
|
||||||
chmod -R 755 /etc/cont-init.d
|
chmod -R 755 /etc/cont-init.d
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ if [ -e "/ENVFILE" ]; then
|
|||||||
|
|
||||||
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi &&
|
if ! command -v bash >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends bash || apk add --no-cache bash) >/dev/null; fi &&
|
||||||
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi &&
|
if ! command -v curl >/dev/null 2>/dev/null; then (apt-get update && apt-get install -yqq --no-install-recommends curl || apk add --no-cache curl) >/dev/null; fi &&
|
||||||
curl -f -L -s -S "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/ha_automatic_packages.sh" --output /ha_automatic_packages.sh &&
|
curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automatic_packages.sh" --output /ha_automatic_packages.sh &&
|
||||||
chmod 777 /ha_automatic_packages.sh &&
|
chmod 777 /ha_automatic_packages.sh &&
|
||||||
eval /./ha_automatic_packages.sh "${PACKAGES:-}" &&
|
eval /./ha_automatic_packages.sh "${PACKAGES:-}" &&
|
||||||
rm /ha_automatic_packages.sh
|
rm /ha_automatic_packages.sh
|
||||||
|
|||||||
@@ -1,61 +1,91 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash disable=SC2016
|
||||||
set -e
|
set -e
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Displays a simple add-on banner on startup
|
# Displays a simple add-on banner on startup
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
if bashio::supervisor.ping; then
|
|
||||||
bashio::log.blue \
|
|
||||||
'-----------------------------------------------------------'
|
|
||||||
bashio::log.blue " Add-on: $(bashio::addon.name)"
|
|
||||||
bashio::log.blue " $(bashio::addon.description)"
|
|
||||||
bashio::log.blue \
|
|
||||||
'-----------------------------------------------------------'
|
|
||||||
|
|
||||||
bashio::log.blue " Add-on version: $(bashio::addon.version)"
|
|
||||||
if bashio::var.true "$(bashio::addon.update_available)"; then
|
|
||||||
bashio::log.magenta ' There is an update available for this add-on!'
|
|
||||||
bashio::log.magenta \
|
|
||||||
" Latest add-on version: $(bashio::addon.version_latest)"
|
|
||||||
bashio::log.magenta ' Please consider upgrading as soon as possible.'
|
|
||||||
else
|
|
||||||
bashio::log.green ' You are running the latest version of this add-on.'
|
|
||||||
fi
|
|
||||||
|
|
||||||
bashio::log.blue " System: $(bashio::info.operating_system)" \
|
|
||||||
" ($(bashio::info.arch) / $(bashio::info.machine))"
|
|
||||||
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
|
|
||||||
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
|
|
||||||
|
|
||||||
|
if ! bashio::supervisor.ping 2>/dev/null; then
|
||||||
|
# Degraded mode if no homeassistant
|
||||||
bashio::log.blue \
|
bashio::log.blue \
|
||||||
'-----------------------------------------------------------'
|
'-----------------------------------------------------------'
|
||||||
bashio::log.blue \
|
bashio::log.blue "Starting addon without HA support"
|
||||||
' Please, share the above information when looking for help'
|
bashio::log.blue "Version : ${BUILD_VERSION:-1.0}"
|
||||||
bashio::log.blue \
|
bashio::log.blue "Please use Docker Compose for env variables"
|
||||||
' or support in, e.g., GitHub, forums'
|
|
||||||
bashio::log.blue \
|
|
||||||
'-----------------------------------------------------------'
|
|
||||||
bashio::log.green \
|
|
||||||
' Provided by: https://github.com/Mesteriis/hassio-addons-avm '
|
|
||||||
bashio::log.blue \
|
bashio::log.blue \
|
||||||
'-----------------------------------------------------------'
|
'-----------------------------------------------------------'
|
||||||
|
# Use environment variables instead of addon options
|
||||||
|
echo "... convert scripts to use environment variables instead of addon options"
|
||||||
|
while IFS= read -r scripts
|
||||||
|
do
|
||||||
|
sed -i -e 's/bashio::config.has_value[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ]/g' \
|
||||||
|
-e 's/bashio::config.true[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"']/[ ! -z "${\1:-}" ] \&\& [ "${\1:-}" = "true" ]/g' \
|
||||||
|
-e 's/\$(bashio::config[[:space:]]*["'"'"']\([^"'"'"']*\)["'"'"'])/${\1:-}/g' \
|
||||||
|
-e 's/\$(bashio::addon.port[[:space:]]*["'"'"']\([0-9]*\)["'"'"'])/${\1:-}/g' \
|
||||||
|
-e 's/bashio::config.require.ssl/true/g' \
|
||||||
|
-e 's/\$(bashio::addon.ingress_port)/""/g' \
|
||||||
|
-e 's/\$(bashio::addon.ingress_entry)/""/g' \
|
||||||
|
-e 's/\$(bashio::addon.ip_address)/""/g' "$scripts"
|
||||||
|
done < <(grep -srl "bashio" /etc/cont-init.d /custom-services.d)
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
bashio::log.blue " Add-on: $(bashio::addon.name)"
|
||||||
|
bashio::log.blue " $(bashio::addon.description)"
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
|
||||||
|
bashio::log.blue " Add-on version: $(bashio::addon.version)"
|
||||||
|
if bashio::var.true "$(bashio::addon.update_available)"; then
|
||||||
|
bashio::log.magenta ' There is an update available for this add-on!'
|
||||||
|
bashio::log.magenta \
|
||||||
|
" Latest add-on version: $(bashio::addon.version_latest)"
|
||||||
|
bashio::log.magenta ' Please consider upgrading as soon as possible.'
|
||||||
|
else
|
||||||
|
bashio::log.green ' You are running the latest version of this add-on.'
|
||||||
|
fi
|
||||||
|
|
||||||
|
bashio::log.blue " System: $(bashio::info.operating_system)"
|
||||||
|
bashio::log.blue " Architecture: $(bashio::info.arch) / $(bashio::info.machine)"
|
||||||
|
bashio::log.blue " Home Assistant Core: $(bashio::info.homeassistant)"
|
||||||
|
bashio::log.blue " Home Assistant Supervisor: $(bashio::info.supervisor)"
|
||||||
|
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
bashio::log.blue \
|
||||||
|
' Please, share the above information when looking for help'
|
||||||
|
bashio::log.blue \
|
||||||
|
' or support in, e.g., GitHub, forums'
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
bashio::log.green \
|
||||||
|
' Provided by: https://github.com/alexbelgium/hassio-addons '
|
||||||
|
bashio::log.blue \
|
||||||
|
'-----------------------------------------------------------'
|
||||||
|
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
# Global actions for all addons
|
# Global actions for all addons
|
||||||
# ==============================================================================
|
# ==============================================================================
|
||||||
if bashio::config.has_value "PUID" && bashio::config.has_value "PGID"; then
|
if bashio::config.has_value "PUID" && bashio::config.has_value "PGID"; then
|
||||||
bashio::log.green \
|
bashio::log.green ' Defining permissions for main user : '
|
||||||
' Defining permissions for main user : '
|
|
||||||
PUID="$(bashio::config "PUID")"
|
PUID="$(bashio::config "PUID")"
|
||||||
PGID="$(bashio::config "PGID")"
|
PGID="$(bashio::config "PGID")"
|
||||||
bashio::log.blue "User UID: $PUID"
|
bashio::log.blue "User UID: $PUID"
|
||||||
bashio::log.blue "User GID : $PGID"
|
bashio::log.blue "User GID: $PGID"
|
||||||
id -u abc &>/dev/null || usermod -o -u "$PUID" abc &>/dev/null || true
|
|
||||||
id -g abc &>/dev/null || groupmod -o -g "$PGID" abc &>/dev/null || true
|
# Only modify user/group if they exist
|
||||||
|
if id abc &>/dev/null; then
|
||||||
|
usermod -o -u "$PUID" abc &>/dev/null
|
||||||
|
fi
|
||||||
|
if getent group abc &>/dev/null; then
|
||||||
|
groupmod -o -g "$PGID" abc &>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
bashio::log.blue \
|
bashio::log.blue \
|
||||||
'-----------------------------------------------------------'
|
'-----------------------------------------------------------'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Clean bashrc file
|
# Clean bashrc file safely
|
||||||
if [ -f ~/.bashrc ]; then rm ~/.bashrc; fi
|
if [ -f ~/.bashrc ]; then : > ~/.bashrc; fi
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! bashio::supervisor.ping 2>/dev/null; then
|
||||||
|
echo "..."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
###################################
|
###################################
|
||||||
# Export all addon options as env #
|
# Export all addon options as env #
|
||||||
###################################
|
###################################
|
||||||
@@ -27,7 +32,7 @@ for KEYS in "${arr[@]}"; do
|
|||||||
VALUE=$(jq ."$KEYS" "${JSONSOURCE}")
|
VALUE=$(jq ."$KEYS" "${JSONSOURCE}")
|
||||||
# Check if the value is an array
|
# Check if the value is an array
|
||||||
if [[ "$VALUE" == \[* ]]; then
|
if [[ "$VALUE" == \[* ]]; then
|
||||||
bashio::log.warning "$VALUE is an array, skipping"
|
bashio::log.warning "One of your option is an array, skipping"
|
||||||
else
|
else
|
||||||
# Continue for single values
|
# Continue for single values
|
||||||
VALUE="${VALUE//[\"\']/}"
|
VALUE="${VALUE//[\"\']/}"
|
||||||
@@ -54,7 +59,7 @@ for KEYS in "${arr[@]}"; do
|
|||||||
VALUE="$secret"
|
VALUE="$secret"
|
||||||
fi
|
fi
|
||||||
# text
|
# text
|
||||||
if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then
|
if bashio::config.false "verbose" || [[ "${KEYS,,}" == *"pass"* ]]; then
|
||||||
bashio::log.blue "${KEYS}=******"
|
bashio::log.blue "${KEYS}=******"
|
||||||
else
|
else
|
||||||
bashio::log.blue "$line"
|
bashio::log.blue "$line"
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! bashio::supervisor.ping 2>/dev/null; then
|
||||||
|
echo "..."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# MOUNT LOCAL SHARES #
|
# MOUNT LOCAL SHARES #
|
||||||
######################
|
######################
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
# shellcheck disable=
|
# shellcheck disable=
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
if ! bashio::supervisor.ping 2>/dev/null; then
|
||||||
|
bashio::log.blue "Disabled : please use another method"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
####################
|
####################
|
||||||
# DEFINE FUNCTIONS #
|
# DEFINE FUNCTIONS #
|
||||||
####################
|
####################
|
||||||
@@ -19,6 +24,7 @@ test_mount () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Exit if can't write
|
# Exit if can't write
|
||||||
|
[[ -e "/mnt/$diskname/testaze" ]] && rm -r "/mnt/$diskname/testaze"
|
||||||
# shellcheck disable=SC2015
|
# shellcheck disable=SC2015
|
||||||
mkdir "/mnt/$diskname/testaze" && touch "/mnt/$diskname/testaze/testaze" && rm -r "/mnt/$diskname/testaze" || ERROR_MOUNT=true
|
mkdir "/mnt/$diskname/testaze" && touch "/mnt/$diskname/testaze/testaze" && rm -r "/mnt/$diskname/testaze" || ERROR_MOUNT=true
|
||||||
if [[ "$ERROR_MOUNT" == "true" ]]; then
|
if [[ "$ERROR_MOUNT" == "true" ]]; then
|
||||||
@@ -65,7 +71,7 @@ if bashio::config.has_value 'networkdisks'; then
|
|||||||
# Alert message that it is a new code
|
# Alert message that it is a new code
|
||||||
if [[ "$(date +"%Y%m%d")" -lt "20240201" ]]; then
|
if [[ "$(date +"%Y%m%d")" -lt "20240201" ]]; then
|
||||||
bashio::log.warning "------------------------"
|
bashio::log.warning "------------------------"
|
||||||
bashio::log.warning "This is a new code, please report any issues on https://github.com/Mesteriis/hassio-addons-avm"
|
bashio::log.warning "This is a new code, please report any issues on https://github.com/alexbelgium/hassio-addons"
|
||||||
bashio::log.warning "------------------------"
|
bashio::log.warning "------------------------"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -7,22 +7,23 @@ set -e
|
|||||||
# INITIALIZATION #
|
# INITIALIZATION #
|
||||||
##################
|
##################
|
||||||
|
|
||||||
# Exit if /config is not mounted
|
# Disable if config not present
|
||||||
if [ ! -d /config ]; then
|
if [ ! -d /config ] || ! bashio::supervisor.ping 2>/dev/null; then
|
||||||
|
echo "..."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define slug
|
# Define slug
|
||||||
slug="${HOSTNAME}"
|
slug="${HOSTNAME/-/_}"
|
||||||
|
slug="${slug#*_}"
|
||||||
|
|
||||||
# Check type of config folder
|
# Check type of config folder
|
||||||
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
|
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
|
||||||
# New config location
|
# New config location
|
||||||
CONFIGLOCATION="/config"
|
CONFIGLOCATION="/config"
|
||||||
CONFIGFILEBROWSER="/addon_configs/$slug/config.yaml"
|
CONFIGFILEBROWSER="/addon_configs/${HOSTNAME/-/_}/config.yaml"
|
||||||
else
|
else
|
||||||
# Legacy config location
|
# Legacy config location
|
||||||
slug="${HOSTNAME#*-}"
|
|
||||||
CONFIGLOCATION="/config/addons_config/${slug}"
|
CONFIGLOCATION="/config/addons_config/${slug}"
|
||||||
CONFIGFILEBROWSER="/homeassistant/addons_config/$slug/config.yaml"
|
CONFIGFILEBROWSER="/homeassistant/addons_config/$slug/config.yaml"
|
||||||
fi
|
fi
|
||||||
@@ -35,6 +36,9 @@ CONFIGSOURCE="$CONFIGLOCATION"/config.yaml
|
|||||||
if bashio::config.has_value 'CONFIG_LOCATION'; then
|
if bashio::config.has_value 'CONFIG_LOCATION'; then
|
||||||
|
|
||||||
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
||||||
|
if [[ "$CONFIGSOURCE" == *.* ]]; then
|
||||||
|
CONFIGSOURCE=$(dirname "$CONFIGSOURCE")
|
||||||
|
fi
|
||||||
# If does not end by config.yaml, remove trailing slash and add config.yaml
|
# If does not end by config.yaml, remove trailing slash and add config.yaml
|
||||||
if [[ "$CONFIGSOURCE" != *".yaml" ]]; then
|
if [[ "$CONFIGSOURCE" != *".yaml" ]]; then
|
||||||
CONFIGSOURCE="${CONFIGSOURCE%/}"/config.yaml
|
CONFIGSOURCE="${CONFIGSOURCE%/}"/config.yaml
|
||||||
@@ -89,7 +93,7 @@ else
|
|||||||
bashio::log.green "If accessing the file with filebrowser it should be mapped to $CONFIGSOURCE"
|
bashio::log.green "If accessing the file with filebrowser it should be mapped to $CONFIGSOURCE"
|
||||||
fi
|
fi
|
||||||
bashio::log.green "---------------------------------------------------------"
|
bashio::log.green "---------------------------------------------------------"
|
||||||
bashio::log.green "Wiki here on how to use : github.com/Mesteriis/hassio-addons-avm/wiki/Add‐ons-feature-:-add-env-variables"
|
bashio::log.green "Wiki here on how to use : github.com/alexbelgium/hassio-addons/wiki/Add‐ons-feature-:-add-env-variables"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Check if config file is there, or create one from template
|
# Check if config file is there, or create one from template
|
||||||
@@ -103,7 +107,7 @@ if [ ! -f "$CONFIGSOURCE" ]; then
|
|||||||
cp /templates/config.yaml "$(dirname "${CONFIGSOURCE}")"
|
cp /templates/config.yaml "$(dirname "${CONFIGSOURCE}")"
|
||||||
else
|
else
|
||||||
# Download template
|
# Download template
|
||||||
TEMPLATESOURCE="https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/config.template"
|
TEMPLATESOURCE="https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/config.template"
|
||||||
curl -f -L -s -S "$TEMPLATESOURCE" --output "$CONFIGSOURCE"
|
curl -f -L -s -S "$TEMPLATESOURCE" --output "$CONFIGSOURCE"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -111,7 +115,7 @@ fi
|
|||||||
# Check if there are lines to read
|
# Check if there are lines to read
|
||||||
cp "$CONFIGSOURCE" /tempenv
|
cp "$CONFIGSOURCE" /tempenv
|
||||||
sed -i '/^#/d' /tempenv
|
sed -i '/^#/d' /tempenv
|
||||||
sed -i '/^ /d' /tempenv
|
sed -i '/^[[:space:]]*$/d' /tempenv
|
||||||
sed -i '/^$/d' /tempenv
|
sed -i '/^$/d' /tempenv
|
||||||
# Exit if empty
|
# Exit if empty
|
||||||
if [ ! -s /tempenv ]; then
|
if [ ! -s /tempenv ]; then
|
||||||
@@ -154,6 +158,10 @@ parse_yaml "$CONFIGSOURCE" "" >/tmpfile
|
|||||||
# Escape dollars
|
# Escape dollars
|
||||||
sed -i 's|$.|\$|g' /tmpfile
|
sed -i 's|$.|\$|g' /tmpfile
|
||||||
|
|
||||||
|
# Look where secrets.yaml is located
|
||||||
|
SECRETSFILE="/config/secrets.yaml"
|
||||||
|
if [ -f "$SECRETSFILE" ]; then SECRETSFILE="/homeassistant/secrets.yaml"; fi
|
||||||
|
|
||||||
while IFS= read -r line; do
|
while IFS= read -r line; do
|
||||||
# Clean output
|
# Clean output
|
||||||
line="${line//[\"\']/}"
|
line="${line//[\"\']/}"
|
||||||
@@ -162,10 +170,10 @@ while IFS= read -r line; do
|
|||||||
echo "secret detected"
|
echo "secret detected"
|
||||||
secret=${line#*secret }
|
secret=${line#*secret }
|
||||||
# Check if single match
|
# Check if single match
|
||||||
secretnum=$(sed -n "/$secret:/=" /config/secrets.yaml)
|
secretnum=$(sed -n "/$secret:/=" "$SECRETSFILE")
|
||||||
[[ $(echo $secretnum) == *' '* ]] && bashio::exit.nok "There are multiple matches for your password name. Please check your secrets.yaml file"
|
[[ $(echo $secretnum) == *' '* ]] && bashio::exit.nok "There are multiple matches for your password name. Please check your secrets.yaml file"
|
||||||
# Get text
|
# Get text
|
||||||
secret=$(sed -n "/$secret:/p" /config/secrets.yaml)
|
secret=$(sed -n "/$secret:/p" "$SECRETSFILE")
|
||||||
secret=${secret#*: }
|
secret=${secret#*: }
|
||||||
line="${line%%=*}='$secret'"
|
line="${line%%=*}='$secret'"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -6,36 +6,37 @@ set -e
|
|||||||
# INITIALIZATION #
|
# INITIALIZATION #
|
||||||
##################
|
##################
|
||||||
|
|
||||||
# Exit if /config is not mounted
|
# Exit if /config is not mounted or HA not used
|
||||||
if [ ! -d /config ]; then
|
if [ ! -d /config ] || ! bashio::supervisor.ping 2>/dev/null; then
|
||||||
|
echo "..."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Define slug
|
# Define slug
|
||||||
slug="${HOSTNAME}"
|
slug="${HOSTNAME/-/_}"
|
||||||
|
slug="${slug#*_}"
|
||||||
|
|
||||||
# Check type of config folder
|
# Check type of config folder
|
||||||
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
|
if [ ! -f /config/configuration.yaml ] && [ ! -f /config/configuration.json ]; then
|
||||||
# New config location
|
# New config location
|
||||||
CONFIGLOCATION="/config"
|
CONFIGLOCATION="/config"
|
||||||
CONFIGFILEBROWSER="/addon_configs/$slug/${HOSTNAME#*-}.sh"
|
CONFIGFILEBROWSER="/addon_configs/${HOSTNAME/-/_}/$slug.sh"
|
||||||
else
|
else
|
||||||
# Legacy config location
|
# Legacy config location
|
||||||
slug="${HOSTNAME#*-}"
|
|
||||||
CONFIGLOCATION="/config/addons_autoscripts"
|
CONFIGLOCATION="/config/addons_autoscripts"
|
||||||
CONFIGFILEBROWSER="/homeassistant/addons_config/${slug}/${slug}.sh"
|
CONFIGFILEBROWSER="/homeassistant/addons_autoscripts/$slug.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Default location
|
# Default location
|
||||||
mkdir -p "$CONFIGLOCATION" || true
|
mkdir -p "$CONFIGLOCATION" || true
|
||||||
CONFIGSOURCE="$CONFIGLOCATION/${HOSTNAME#*-}.sh"
|
CONFIGSOURCE="$CONFIGLOCATION/$slug.sh"
|
||||||
|
|
||||||
bashio::log.green "Execute $CONFIGFILEBROWSER if existing"
|
bashio::log.green "Execute $CONFIGFILEBROWSER if existing"
|
||||||
bashio::log.green "Wiki here : github.com/Mesteriis/hassio-addons-avm/wiki/Add-ons-feature-:-customisation"
|
bashio::log.green "Wiki here : github.com/alexbelgium/hassio-addons/wiki/Add-ons-feature-:-customisation"
|
||||||
|
|
||||||
# Download template if no script found and exit
|
# Download template if no script found and exit
|
||||||
if [ ! -f "$CONFIGSOURCE" ]; then
|
if [ ! -f "$CONFIGSOURCE" ]; then
|
||||||
TEMPLATESOURCE="https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/script.template"
|
TEMPLATESOURCE="https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/script.template"
|
||||||
curl -f -L -s -S "$TEMPLATESOURCE" --output "$CONFIGSOURCE" || true
|
curl -f -L -s -S "$TEMPLATESOURCE" --output "$CONFIGSOURCE" || true
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
#============================#
|
||||||
|
# ALEXBELGIUM'S ENV INJECTOR #
|
||||||
|
#============================#
|
||||||
|
#
|
||||||
# All env variables set in this file will be enabled in the app
|
# All env variables set in this file will be enabled in the app
|
||||||
# This allows enabling more options that normally available in the addon options
|
# This allows enabling more options that normally available in the addon options
|
||||||
# This file must be filled according to the yaml format.
|
# This file must be filled according to the yaml format.
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ if ! command -v curl >/dev/null 2>/dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Call apps installer script if needed
|
# Call apps installer script if needed
|
||||||
curl -f -L -s -S "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/ha_automatic_packages.sh" --output /ha_automatic_packages.sh
|
curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/ha_automatic_packages.sh" --output /ha_automatic_packages.sh
|
||||||
chmod 777 /ha_automatic_packages.sh
|
chmod 777 /ha_automatic_packages.sh
|
||||||
eval /./ha_automatic_packages.sh "${PACKAGES:-}"
|
eval /./ha_automatic_packages.sh "${PACKAGES:-}"
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ for files in "/etc/cont-init.d" "/etc/services.d"; do
|
|||||||
COMMAND="mount"
|
COMMAND="mount"
|
||||||
if grep -q -rnw "$files/" -e "$COMMAND"; then
|
if grep -q -rnw "$files/" -e "$COMMAND"; then
|
||||||
[ "$VERBOSE" = true ] && echo "$COMMAND required"
|
[ "$VERBOSE" = true ] && echo "$COMMAND required"
|
||||||
[ "$PACKMANAGER" = "apk" ] && PACKAGES="$PACKAGES exfatprogs ntfs-3g squashfs-tools fuse lsblk"
|
[ "$PACKMANAGER" = "apk" ] && PACKAGES="$PACKAGES exfatprogs ntfs-3g ntfs-3g-progs squashfs-tools fuse lsblk"
|
||||||
[ "$PACKMANAGER" = "apt" ] && PACKAGES="$PACKAGES exfat* ntfs* squashfs-tools util-linux"
|
[ "$PACKMANAGER" = "apt" ] && PACKAGES="$PACKAGES exfat* ntfs* squashfs-tools util-linux"
|
||||||
#[ "$PACKMANAGER" = "pacman" ] && PACKAGES="$PACKAGES ntfs-3g"
|
#[ "$PACKMANAGER" = "pacman" ] && PACKAGES="$PACKAGES ntfs-3g"
|
||||||
fi
|
fi
|
||||||
@@ -216,10 +216,10 @@ fi
|
|||||||
#######################
|
#######################
|
||||||
|
|
||||||
# Install micro texteditor
|
# Install micro texteditor
|
||||||
curl https://getmic.ro | bash
|
curl https://getmic.ro | bash || true
|
||||||
mv micro /usr/bin
|
mv micro /usr/bin || true
|
||||||
micro -plugin install bounce
|
micro -plugin install bounce || true
|
||||||
micro -plugin install filemanager
|
micro -plugin install filemanager || true
|
||||||
|
|
||||||
for files in "/etc/services.d" "/etc/cont-init.d"; do
|
for files in "/etc/services.d" "/etc/cont-init.d"; do
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ mkdir -p /etc/cont-init.d
|
|||||||
|
|
||||||
# Download scripts
|
# Download scripts
|
||||||
for scripts in $MODULES; do
|
for scripts in $MODULES; do
|
||||||
echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/Mesteriis/hassio-addons-avm/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" &&
|
echo "$scripts" && curl -f -L -s -S "https://raw.githubusercontent.com/alexbelgium/hassio-addons/master/.templates/$scripts" -o /etc/cont-init.d/"$scripts" &&
|
||||||
[ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] ||
|
[ "$(sed -n '/\/bin/p;q' /etc/cont-init.d/"$scripts")" != "" ] ||
|
||||||
(echo "script failed to install $scripts" && exit 1)
|
(echo "script failed to install $scripts" && exit 1)
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#!/command/with-contenv bashio
|
#!/command/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
echo "Starting..."
|
echo "Starting..."
|
||||||
|
|
||||||
####################
|
####################
|
||||||
@@ -11,11 +12,11 @@ for SCRIPTS in /etc/cont-init.d/*; do
|
|||||||
echo "$SCRIPTS: executing"
|
echo "$SCRIPTS: executing"
|
||||||
|
|
||||||
# Check if run as root
|
# Check if run as root
|
||||||
if test "$(id -u)" == 0 && test "$(id -u)" == 0; then
|
if [ "$(id -u)" -eq 0 ]; then
|
||||||
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
|
chown "$(id -u)":"$(id -g)" "$SCRIPTS"
|
||||||
chmod a+x "$SCRIPTS"
|
chmod a+x "$SCRIPTS"
|
||||||
else
|
else
|
||||||
bashio::log.warning "Script executed with user $(id -u):$(id -g), things can break and chown won't work"
|
echo -e "\e[38;5;214m$(date) WARNING: Script executed with user $(id -u):$(id -g), things can break and chown won't work\e[0m"
|
||||||
# Disable chown and chmod in scripts
|
# Disable chown and chmod in scripts
|
||||||
sed -i "s/^chown /true # chown /g" "$SCRIPTS"
|
sed -i "s/^chown /true # chown /g" "$SCRIPTS"
|
||||||
sed -i "s/ chown / true # chown /g" "$SCRIPTS"
|
sed -i "s/ chown / true # chown /g" "$SCRIPTS"
|
||||||
@@ -26,34 +27,70 @@ for SCRIPTS in /etc/cont-init.d/*; do
|
|||||||
# Get current shebang, if not available use another
|
# Get current shebang, if not available use another
|
||||||
currentshebang="$(sed -n '1{s/^#![[:blank:]]*//p;q}' "$SCRIPTS")"
|
currentshebang="$(sed -n '1{s/^#![[:blank:]]*//p;q}' "$SCRIPTS")"
|
||||||
if [ ! -f "${currentshebang%% *}" ]; then
|
if [ ! -f "${currentshebang%% *}" ]; then
|
||||||
for shebang in "/command/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/bin/bash" "/bin/sh"; do if [ -f "${shebang%% *}" ]; then break; fi; done
|
for shebang in "/command/with-contenv bashio" "/usr/bin/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/usr/bin/bash" "/usr/bin/sh" "/bin/bash" "/bin/sh"; do
|
||||||
|
command_path="${shebang%% *}"
|
||||||
|
if [ -x "$command_path" ] && "$command_path" echo "yes" >/dev/null 2>&1; then
|
||||||
|
echo "Valid shebang: $shebang"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
sed -i "s|$currentshebang|$shebang|g" "$SCRIPTS"
|
sed -i "s|$currentshebang|$shebang|g" "$SCRIPTS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use source to share env variables when requested
|
# Use source to share env variables when requested
|
||||||
if [ "${ha_entry_source:-null}" = true ] && command -v "source" &>/dev/null; then
|
if [ "${ha_entry_source:-null}" = true ] && command -v "source" &>/dev/null; then
|
||||||
# Exit cannot be used with source
|
|
||||||
sed -i "s/(.*\s|^)exit ([0-9]+)/\1 return \2 || exit \2/g" "$SCRIPTS"
|
sed -i "s/(.*\s|^)exit ([0-9]+)/\1 return \2 || exit \2/g" "$SCRIPTS"
|
||||||
sed -i "s/bashio::exit.nok/return 1/g" "$SCRIPTS"
|
sed -i "s/bashio::exit.nok/return 1/g" "$SCRIPTS"
|
||||||
sed -i "s/bashio::exit.ok/return 0/g" "$SCRIPTS"
|
sed -i "s/bashio::exit.ok/return 0/g" "$SCRIPTS"
|
||||||
# shellcheck source=/dev/null
|
# shellcheck disable=SC1090
|
||||||
source "$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"
|
source "$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"
|
||||||
else
|
else
|
||||||
# Support for posix only shell
|
"$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"
|
||||||
/."$SCRIPTS" || echo -e "\033[0;31mError\033[0m : $SCRIPTS exiting $?"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm "$SCRIPTS"
|
rm "$SCRIPTS"
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
######################
|
######################
|
||||||
# Starting container #
|
# Starting container #
|
||||||
######################
|
######################
|
||||||
|
|
||||||
echo " "
|
# If PID 1, keep alive and manage sigterm
|
||||||
echo -e "\033[0;32mStarting the upstream container\033[0m"
|
if [ "$$" -eq 1 ]; then
|
||||||
echo " "
|
echo " "
|
||||||
|
echo -e "\033[0;32mEverything started!\033[0m"
|
||||||
# Launch lsio mods
|
terminate() {
|
||||||
if [ -f /docker-mods ]; then exec /docker-mods; fi
|
echo "Termination signal received, forwarding to subprocesses..."
|
||||||
|
# Terminate all subprocesses
|
||||||
|
if command -v pgrep &>/dev/null; then
|
||||||
|
for pid in $(pgrep -P $$); do
|
||||||
|
echo "Terminating child PID $pid"
|
||||||
|
kill -TERM "$pid" 2>/dev/null || echo "Failed to terminate PID $pid"
|
||||||
|
done
|
||||||
|
else
|
||||||
|
# Fallback to iterating through /proc if pgrep is not available
|
||||||
|
for pid in /proc/[0-9]*/; do
|
||||||
|
pid=${pid#/proc/}
|
||||||
|
pid=${pid%/}
|
||||||
|
if [[ "$pid" -ne 1 ]] && grep -q "^PPid:\s*$$" "/proc/$pid/status" 2>/dev/null; then
|
||||||
|
echo "Terminating child PID $pid"
|
||||||
|
kill -TERM "$pid" 2>/dev/null || echo "Failed to terminate PID $pid"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
wait
|
||||||
|
echo "All subprocesses terminated. Exiting."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
trap terminate SIGTERM SIGINT
|
||||||
|
while :; do sleep infinity & wait $!; done
|
||||||
|
else
|
||||||
|
echo " "
|
||||||
|
echo -e "\033[0;32mStarting the upstream container\033[0m"
|
||||||
|
echo " "
|
||||||
|
# Launch lsio mods
|
||||||
|
if [ -f /docker-mods ]; then exec /docker-mods; fi
|
||||||
|
fi
|
||||||
|
|||||||
@@ -39,7 +39,9 @@ mkdir -p /run/s6/container_environment
|
|||||||
|
|
||||||
# Check if shebang exists
|
# Check if shebang exists
|
||||||
for shebang in "/command/with-contenv bashio" "/usr/bin/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/usr/bin/bash" "/usr/bin/sh" "/bin/bash" "/bin/sh"; do
|
for shebang in "/command/with-contenv bashio" "/usr/bin/with-contenv bashio" "/usr/bin/env bashio" "/usr/bin/bashio" "/usr/bin/bash" "/usr/bin/sh" "/bin/bash" "/bin/sh"; do
|
||||||
if [ -f "${shebang%% *}" ]; then
|
command_path="${shebang%% *}"
|
||||||
|
if [ -x "$command_path" ] && "$command_path" echo "yes" >/dev/null 2>&1; then
|
||||||
|
echo "Valid shebang: $shebang"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ if [ -f /etc/s6-overlay/s6-rc.d/svc-cron/run ]; then
|
|||||||
sed -i "/exec \/usr\/sbin\/cron/c exec /usr/sbin/cron -f &>/proc/1/fd/1" /etc/s6-overlay/s6-rc.d/svc-cron/run
|
sed -i "/exec \/usr\/sbin\/cron/c exec /usr/sbin/cron -f &>/proc/1/fd/1" /etc/s6-overlay/s6-rc.d/svc-cron/run
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# variables not found
|
||||||
|
for file in $(grep -srl "/usr/bin" /etc/cont-init.d /etc/s6-overlay/s6-rc.d); do
|
||||||
|
sed -i "1a set +u" "$file"
|
||||||
|
done
|
||||||
|
|
||||||
# Replace lsiown if not found
|
# Replace lsiown if not found
|
||||||
if [ ! -f /usr/bin/lsiown ]; then
|
if [ ! -f /usr/bin/lsiown ]; then
|
||||||
for file in $(grep -sril "lsiown" /etc); do
|
for file in $(grep -sril "lsiown" /etc); do
|
||||||
|
|||||||
@@ -6,4 +6,4 @@
|
|||||||
#################
|
#################
|
||||||
|
|
||||||
# Any commands written in this bash script will be executed at addon start
|
# Any commands written in this bash script will be executed at addon start
|
||||||
# See guide here : https://github.com/Mesteriis/hassio-addons-avm/wiki/Add%E2%80%90ons-feature-:-customisation
|
# See guide here : https://github.com/alexbelgium/hassio-addons/wiki/Add%E2%80%90ons-feature-:-customisation
|
||||||
|
|||||||
Reference in New Issue
Block a user