starcitizen-lug/lug-helper

Helper Script considers EAC workaround deployed even if commented out.

jmswick opened this issue · 3 comments

If someone has commented out the EAC work around for other testing, the script will still consider the workaround deployed with the current grep:

    if grep "$eac_hosts" /etc/hosts; then
        message info "The Easy Anti-Cheat workaround has already been applied.\nYou're all set!"
        return 1
    fi

Performing a grep with the a search of "^$eac_hosts" would validate that the workaround is not commented out in a user's hostfile if they've forgotten they commented it out.

$ echo $eac_hosts
127.0.0.1 modules-cdn.eac-prod.on.epicgames.com
$ grep "$eac_hosts" /tmp/hosts; echo $?
#127.0.0.1 modules-cdn.eac-prod.on.epicgames.com
0
$ grep "^$eac_hosts" /tmp/hosts; echo $?
1

However, I'm not sure what course of action the script should take in this situation. Should it just warn the user? Or should it uncomment or re-apply the workaround?

Yeah, we were discussing this in the past. Back then we hoped the workaround would just be required for a short while so we concluded that someone who manually commented out the workaround would remember he did so.
As it seems like the workaround is copying the pandemic it might be a good idea to include this, i agree.
I tend to say a warning would be best in that case - just to avoid messing up the hosts file if the user did something unexpected there?

I tend to say a warning would be best in that case - just to avoid messing up the hosts file if the user did something unexpected there?

I agree!

Implemented in ba907c4 - thanks for the input @jmswick ! :)