mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-22 20:46:28 +01:00
39 lines
788 B
Bash
Executable File
39 lines
788 B
Bash
Executable File
#!/bin/bash
|
|
# shellcheck shell=bash
|
|
set -e
|
|
|
|
CONFIGSOURCE="/data"
|
|
|
|
# Use ssl
|
|
if [ -d /ssl ]; then
|
|
mkdir -p /cert
|
|
cp -r /ssl/* /cert
|
|
chown -R 508:508 /cert
|
|
fi
|
|
|
|
# Create directory
|
|
if [ ! -f "$CONFIGSOURCE" ]; then
|
|
echo "Creating directory"
|
|
mkdir -p "$CONFIGSOURCE"
|
|
fi
|
|
|
|
# Ensure structure is correct
|
|
cp -rnf /opt/tplink/EAPController/data/* "$CONFIGSOURCE"
|
|
|
|
echo "Creating symlink"
|
|
# Clean existing folder
|
|
rm -r /opt/tplink/EAPController/data/*
|
|
|
|
# Create symlinks for all files in /data
|
|
# shellcheck disable=SC2086
|
|
for files in "$CONFIGSOURCE"/*; do
|
|
if [ -e "$files" ]; then
|
|
ln -s "$files" /opt/tplink/EAPController/data
|
|
fi
|
|
done
|
|
|
|
# Make sure permissions are right
|
|
echo "Updating permissions"
|
|
chmod -R 777 "$CONFIGSOURCE"
|
|
chown -R "508:508" "$CONFIGSOURCE"
|