distribution/packages/sysutils/systemd/scripts/userconfig-setup

29 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
# Remove those sample files that we manage
for sample in $(find /storage/.config -name '*.sample' 2>/dev/null); do
[ -f /usr/config/${sample:16} ] && rm -f ${sample}
done
if [ ! -e "/storage/.configured" ]
then
# Copy config files, but don't overwrite. Only run if /storage is fresh
## cp -iRp /usr/config/* /storage/.config/ &>/dev/null
## ignore es_systems.cfg and switch to rsync
rsync -a --ignore-existing --exclude=es_systems.cfg /usr/config/* /storage/.config/
mkdir -p /storage/.config/emulationstation/themes
ln -s /usr/share/themes/es-theme-art-book-next /storage/.config/emulationstation/themes/system-theme
hres="$(fbset 2>/dev/null | awk '/geometry/ { print $2 }')"
cp -f /usr/config/splash/splash-${hres}.png /storage/.config/emulationstation/resources/logo.png
fi
if [ ! -d "/storage/.config/emulationstation/locale/" ]
then
rsync -a --delete /usr/config/locale/ /storage/.config/emulationstation/locale/
fi