Reg exec module

J@g@dee5h djfueese at gmail.com
Fri Oct 23 08:08:42 CEST 2015


Hello team,

I am stuck with exec module. Need to run a script with radius exec module.

I have defined this script in sites-enabled/default file as below

get_streaming_data_usage := `/scripts/get_streaming_data_usage.sh
%{Framed-IP-Address}`

get_streaming_data_usage.sh file contains

#/bin/bash

#get the framed IP_address:
framed_ip_address = $1
#Get the usage in bytes:
get_streaming_data_usage = `grep "$framed_ip_address"
/scripts/user-bandwidth.txt | cut -d , -f 4`


But I am getting the error as "Exec format error" in debug log. Please find
the debug log as below.

Fri Oct 23 11:32:11 2015 : Debug: (1)       Executing:
/scripts/get_streaming_data_usage.sh %{Framed-IP-Address}:
Fri Oct 23 11:32:11 2015 : Debug: %{Framed-IP-Address}
Fri Oct 23 11:32:11 2015 : Debug: Parsed xlat tree:
Fri Oct 23 11:32:11 2015 : Debug: attribute --> Framed-IP-Address
Fri Oct 23 11:32:11 2015 : Debug: (1)       EXPAND %{Framed-IP-Address}
Fri Oct 23 11:32:11 2015 : Debug: (1)          --> 20.0.0.254
Fri Oct 23 11:32:11 2015 : ERROR: (1)       Program returned code (2) and
output 'Failed to execute "/scripts/get_streaming_data_usage.sh": Exec
format error'
Fri Oct 23 11:32:11 2015 : Debug: (1)     } # update control = fail

Please help to resolve this issue.


More information about the Freeradius-Users mailing list