Switch to Chromium

This commit is contained in:
Michael Bradley 2025-05-18 00:36:49 -04:00
parent e9df645b49
commit d9fc5df080
Signed by: MichaelBradley
SSH key fingerprint: SHA256:BKO2eI2LPsCbQS3n3i5SdwZTAIV3F1lHezR07qP+Ob0
8 changed files with 24 additions and 154 deletions

View file

@ -5,8 +5,7 @@ set -u # Treat unset variables as an error.
# Make sure some directories are created.
mkdir -p /config/downloads
mkdir -p /config/log/firefox
mkdir -p /config/profile
mkdir -p /config/log/chromium
# Generate machine id.
if [ ! -f /config/machine-id ]; then
@ -14,14 +13,8 @@ if [ ! -f /config/machine-id ]; then
cat /proc/sys/kernel/random/uuid | tr -d '-' > /config/machine-id
fi
# Clean/optimize Firefox databases.
#if [ -d /config/.mozilla/firefox ] && [ -d /config/profile ]; then
# [ -f /config/.mozilla/firefox/profiles.ini ] || cp /defaults/profiles.ini /config/.mozilla/firefox/
# env HOME=/config /usr/bin/profile-cleaner f
#fi
# Initialize log files.
for LOG_FILE in /config/log/firefox/output.log /config/log/firefox/error.log
for LOG_FILE in /config/log/chromium/output.log /config/log/chromium/error.log
do
touch "$LOG_FILE"

View file

@ -1,47 +0,0 @@
#!/bin/sh
set -e
PREF_FILE="${1:-/config/profile/prefs.js}"
if [ -z "$PREF_FILE" ]; then
echo "ERROR: Preference file not set."
exit 1
fi
mkdir -p "$(dirname "$PREF_FILE")"
[ -f "$PREF_FILE" ] || touch "$PREF_FILE"
env | grep "^FF_PREF_" | while read -r ENV
do
ENAME="$(echo "$ENV" | cut -d '=' -f1)"
EVAL="$(echo "$ENV" | cut -d '=' -f2-)"
if [ -z "$EVAL" ]; then
echo "Skipping environment variable '$ENAME': no value set."
continue
fi
if echo "$EVAL" | grep -q "="; then
PNAME="$(echo "$EVAL" | cut -d '=' -f1)"
PVAL="$(echo "$EVAL" | cut -d '=' -f2-)"
[ -n "$PVAL" ] || PVAL='""'
else
PNAME="$EVAL"
PVAL='""'
fi
if [ "$PVAL" = "UNSET" ]; then
echo "Removing preference '$PNAME'..."
sed -i "/user_pref(\"$PNAME\",.*);/d" "$PREF_FILE"
elif grep -q "user_pref(\"$PNAME\"," "$PREF_FILE"; then
echo "Setting preference '$PNAME'..."
sed -i "/user_pref(\"$PNAME\",.*);/d" "$PREF_FILE"
echo "user_pref(\"$PNAME\", $(echo "$PVAL" | sed 's|\\|\\\\|g'));" >> "$PREF_FILE"
else
echo "Setting new preference '$PNAME'..."
echo "user_pref(\"$PNAME\", $(echo "$PVAL" | sed 's|\\|\\\\|g'));" >> "$PREF_FILE"
fi
done
# vim:ft=sh:ts=4:sw=4:et:sts=4