diff options
| author | Arcade Wise <l3gacy.b3ta@disroot.org> | 2023-07-10 20:27:15 +0000 |
|---|---|---|
| committer | Arcade Wise <l3gacy.b3ta@disroot.org> | 2023-07-10 20:27:15 +0000 |
| commit | 4e1c1942285e13ded40e5b69c2ff1ea6dcb4aa59 (patch) | |
| tree | e70626bc76d94d7289893d0c2f31209f9e3c1cc1 | |
| parent | fix laser region camera code (diff) | |
| download | folk-4e1c1942285e13ded40e5b69c2ff1ea6dcb4aa59.tar.gz folk-4e1c1942285e13ded40e5b69c2ff1ea6dcb4aa59.zip | |
Better privacy for wifi in hosts.tcl
| -rw-r--r-- | hosts.tcl | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,13 @@ +# TODO: Find a good C sha-smth instead of this. +proc hashString {str} { + set hash 0 + foreach char [split $str ""] { + set ascii [scan $char %c] + set hash [expr {($hash * 31 + $ascii) & 0xffffffff}] + } + set hash +} + if {[info exists ::env(FOLK_SHARE_NODE)]} { set ::shareNode $::env(FOLK_SHARE_NODE) } else { @@ -20,6 +30,8 @@ if {[info exists ::env(FOLK_SHARE_NODE)]} { set ::shareNode "folk0.local" } elseif {[string match "_onefact.org*" $wifi]} { set ::shareNode "folk-onefact.local" + } elseif {[hashString $wifi] eq 4077950650 || [hashString $wifi] eq 862457117} { + set ::shareNode "folk-arc.local" } else { # there's no default. } |
