Update prefsCleaner.sh

This commit is contained in:
claustromaniac 2018-04-23 16:17:02 +00:00 committed by GitHub
parent 89e603d7da
commit 7f095463b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,14 +37,13 @@ fClean() {
# the magic happens here
prefs="@@"
prefexp="user_pref[ ]*\([ ]*[\"']([^\"']*)[\"'][ ]*,"
grep -E "${prefexp}" user.js >/tmp/userjs_updater_temp.dat
while read line; do
while read -r line; do
if [[ "$line" =~ $prefexp ]]; then
if [[ $prefs != *"@@${BASH_REMATCH[1]}@@"* ]]; then
prefs="${prefs}${BASH_REMATCH[1]}@@"
fi
fi
done < /tmp/userjs_updater_temp.dat
done <<< "`grep -E "$prefexp" user.js`"
while IFS='' read -r line || [[ -n "$line" ]]; do
if [[ "$line" =~ ^$prefexp ]]; then