Getting value from shell scripts
Randeep
randeep123 at gmail.com
Thu Oct 22 10:34:58 CEST 2015
Hi,
I have wrote a shell script and defined in exec module.
exec get_streaming_data_usage {
wait = yes
program = "/bin/bash /scripts/get_streaming_data_usage.sh
%{Framed-IP-Address}"
input_pairs = request
#output_pairs = reply
shell_escape = yes
#output = file
}
And I am executing in /usr/local/etc/raddb/sites-enabled/default
get_streaming_data_usage
Script is as follows:
[root at freeradius ~]# cat /scripts/get_streaming_data_usage.sh
#/bin/bash
#get the framed IP_address:
framed_ip_address = $1
#Get the usage in bytes:
data_usage = `grep "$framed_ip_address" /scripts/user-bandwidth.txt | cut
-d , -f 4`
How can I get the value of data_usage inside the file
/usr/local/etc/raddb/sites-enabled/default
Please help
--
Randeep
Mob: +919447831699[kerala]
Mob: +919880050349[B'lore]
http://twitter.com/Randeeppr
http://in.linkedin.com/in/randeeppr
[image: --]
Randeep Raman
[image: http://]about.me/Randeeppr
<http://about.me/Randeeppr>
More information about the Freeradius-Users
mailing list