# resetprop_if_diff resetprop_if_diff() { local NAME="$1" local EXPECTED="$2" local CURRENT="$(resetprop "$NAME")" [ -z "$CURRENT" ] || [ "$CURRENT" = "$EXPECTED" ] || resetprop -n "$NAME" "$EXPECTED" } # resetprop_if_match resetprop_if_match() { local NAME="$1" local CONTAINS="$2" local VALUE="$3" [[ "$(resetprop "$NAME")" = *"$CONTAINS"* ]] && resetprop -n "$NAME" "$VALUE" }