diff --git a/modules/rhizo_base/manifests/init.pp b/modules/rhizo_base/manifests/init.pp index a7e3786..a63760f 100644 --- a/modules/rhizo_base/manifests/init.pp +++ b/modules/rhizo_base/manifests/init.pp @@ -160,6 +160,13 @@ class rhizo_base { Exec['restart-rapi'] ], } + file { '/var/rhizomatica/bin/get_account_balance.sh': + ensure => present, + content => template('rhizo_base/get_account_balance.sh.erb'), + require => Vcsrepo['/var/rhizomatica'], + } + + file { '/var/rhizomatica/rccn/config_values.py': ensure => present, content => template('rhizo_base/config_values.py.erb'), diff --git a/modules/rhizo_base/templates/get_account_balance.sh.erb b/modules/rhizo_base/templates/get_account_balance.sh.erb new file mode 100644 index 0000000..6dd35fa --- /dev/null +++ b/modules/rhizo_base/templates/get_account_balance.sh.erb @@ -0,0 +1,7 @@ +#!/bin/bash +# Write here the script to return the current balance for the voip account + +USERNAME="<%= @voip_username %>" +PIN="<%= @voip_password %>" + +#/usr/bin/curl -c /tmp/cookie.txt -L --data "p_sa=$USERNAME&p_pin=$PIN&p_nic=200&p_appname=reseller&p_formlang=english&dest=/account/reseller/english/splash.asp" "https://www.myaccountcenter.net/account/lookup.asp?WCI=login" 2>/dev/null | grep 'Funds Remaining' | awk -F'$' '{print $2}' | tr '' ' '