firefox: make combined user.js a little prettier

master
Alan Faubert 9 months ago
parent e84d8245cc
commit d282411df2
  1. 12
      config.sh

@ -83,11 +83,17 @@ while :; do
for dir in firefox/*; do
[ -d "$dir" ] || continue
config="$(basename "$dir")"
truncate --size=0 firefox/"$config"/user.js
echo $'//\n// Generated at '"$(date)"$'\n//' > firefox/"$config"/user.js
IFS='+' read -a pieces <<< "$config"
for piece in "${pieces[@]}"; do
[ -f firefox/"$piece".js ] && cat firefox/"$piece".js >> firefox/"$config"/user.js
[ -f firefox/"$piece".pac ] && echo 'user_pref("network.proxy.autoconfig_url", "'file:///"${root_win//\\//}"/firefox/"$piece".pac$'");\nuser_pref("network.proxy.type", 2);' >> firefox/"$config"/user.js
if [ -f firefox/"$piece".js ]; then
echo "// --- $piece.js ---" >> firefox/"$config"/user.js
cat firefox/"$piece".js >> firefox/"$config"/user.js
fi
if [ -f firefox/"$piece".pac ]; then
echo "// --- $piece.pac ---" >> firefox/"$config"/user.js
echo 'user_pref("network.proxy.autoconfig_url", "'file:///"${root_win//\\//}"/firefox/"$piece".pac$'");\nuser_pref("network.proxy.type", 2);' >> firefox/"$config"/user.js
fi
done
done
true

Loading…
Cancel
Save