Skip to content

Instantly share code, notes, and snippets.

@gabtastic
Last active September 22, 2015 21:16
Show Gist options
  • Save gabtastic/03269d53883f0cc1ae3c to your computer and use it in GitHub Desktop.
Save gabtastic/03269d53883f0cc1ae3c to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'json'
hostname = `hostname`
# Lookup coordinates and determine timezone
alfred_info = JSON.parse(`curl -s "http://api.atlas.intello.com/ihotel/devices?key=123&hostname=#{hostname}"`, quirks_mode:true)
account = alfred_info[0]['account']
province = alfred_info[0]['province'].downcase
unless account != 'Active Networks'
puts `sed -i s/ZONEDIRECTOR_PASSWORD=\\"ihintl\\"/ZONEDIRECTOR_PASSWORD=\\"lmaactive#{province}\\"/ /etc/profile.d/panorama.sh`
puts `sed -i s/ZONEDIRECTOR_USERNAME=\\"support\\"/ZONEDIRECTOR_USERNAME=\\"admin\\"/ /etc/profile.d/panorama.sh`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment