Skip to content

Instantly share code, notes, and snippets.

@zpeters zpeters/annex-cost.tcl
Last active Feb 27, 2017

Embed
What would you like to do?
#!/usr/bin/env tclsh
# "localserver" is the name of my server when i'm at home (internal networks dns name)
# "origin" is the name of the same server when i'm on the road (it's external dns name)
# "whereami" is a command that tells if i am "Remote" or "Home". See
# https://gist.github.com/zpeters/cb8c2be53fd41b4d04a78fe81aaaea58
set remote_name [lindex $argv 0]
set location [exec whereami]
if {$location == "Remote"} {
if {$remote_name == "localserver"} {
puts 1000
} elseif {$remote_name == "origin"} {
puts 50
}
} else {
if {$remote_name == "localserver"} {
puts 50
} elseif {$remote_name == "origin"} {
puts 1000
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.