How to set multiple reply values via a single SQL query?

Alan DeKok aland at deployingradius.com
Tue Mar 3 21:52:26 CET 2015


On Mar 3, 2015, at 3:41 PM, James Wood <james.wood at purplewifi.com> wrote:
> How can I split this in the FreeRadius conf in to the three separate variables using # as the delimiter?

  Regular expressions.  Put the data into a temporary attribute:

	update control {
		Tmp-String-0 := “”%{sql:SELECT CONCAT(`Session-Timeout`, '#', `Idle-Timeout`, '#', `Filter-Id`) FROM settings…}"
	}

	if (Tmp-String-0 =~ /^([^#]+)#([^#]+)([^#]+)/) {
		update reply {
			Session-Timeout := “%{1}”
			Idle-Timeout := “%{2}”
			Filter-Id := “%{3}"
		}
	}

  That should work…

  Alan DeKok.




More information about the Freeradius-Users mailing list