| Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 1 | #!/bin/sh | 
|  | 2 | # | 
|  | 3 |  | 
|  | 4 | # prepare testing config | 
|  | 5 | CONF_USERS=`readlink -f /etc/raddb/users` | 
|  | 6 | mv ${CONF_USERS} ${CONF_USERS}_orig | 
|  | 7 | echo "testing Cleartext-Password := \"testpassword\"" > ${CONF_USERS} | 
|  | 8 | cat ${CONF_USERS}_orig >> ${CONF_USERS} | 
|  | 9 |  | 
|  | 10 | # restart radiusd server | 
|  | 11 | systemctl restart radiusd || /etc/init.d/radiusd restart || { | 
|  | 12 | echo "FAIL: Start radiusd service." | 
|  | 13 | exit 1 | 
|  | 14 | } | 
|  | 15 |  | 
|  | 16 | # run teests | 
|  | 17 | perl test.pl | 
|  | 18 |  | 
|  | 19 | # restore the config and restart | 
|  | 20 | mv ${CONF_USERS}_orig ${CONF_USERS} | 
|  | 21 | systemctl restart radiusd || /etc/init.d/radiusd restart |