refactor: remove dead code, fix home screen config bug

This commit is contained in:
2026-05-23 13:57:35 +00:00
parent e9207b4315
commit 312db58775
3 changed files with 13 additions and 22 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ inject_config() {
if [ -f "$config" ]; then
local config_json=$(cat "$config" | sed 's/\\/\\\\/g' | sed 's/"/\\"/g' | tr '\n' ' ')
sed "s|const config = {.*};|const config = $config_json;|" "$src" > "$dst"
sed "s|const config = {};|const config = $config_json;|" "$src" > "$dst"
echo " Injected config.json into home screen"
else
cp "$src" "$dst"
@@ -67,7 +67,7 @@ if [ -n "$KIOSK" ]; then
git pull
# Inject config at deploy time
config_json=\$(cat config.json | sed 's/\\\\/\\\\\\\\/g' | sed 's/\"/\\\\\"/g' | tr '\n' ' ')
sed \"s|const config = {.*};|const config = \$config_json;|\" home-screen-index.html > /home/jgitta/kiosk-home/index.html
sed \"s|const config = {};|const config = \$config_json;|\" home-screen-index.html > /home/jgitta/kiosk-home/index.html
/usr/local/bin/kiosk-restart
"
echo " Production updated."