mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-02-08 12:54:54 +01:00
19 lines
497 B
Bash
19 lines
497 B
Bash
#!/usr/bin/env bashio
|
|
# shellcheck shell=bash
|
|
|
|
CONFIGSOURCE=$(bashio::config "CONFIG_LOCATION")
|
|
CONFIGSOURCE=$(dirname "$CONFIGSOURCE")
|
|
|
|
# Create directory
|
|
mkdir -p "$CONFIGSOURCE" || true
|
|
mkdir -p "$CONFIGSOURCE/import_files" || true
|
|
mkdir -p "$CONFIGSOURCE/configurations" || true
|
|
|
|
# Create symlinks
|
|
cp -rnf /data/configurations "$CONFIGSOURCE"
|
|
rm -r /data/configurations
|
|
ln -s "$CONFIGSOURCE"/configurations /data
|
|
|
|
# Make sure permissions are right
|
|
chown -R "$(id -u):$(id -g)" "$CONFIGSOURCE"
|