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