From aca3110bb649b46722d02c3780b7d7f5903faa47 Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Fri, 10 Feb 2012 20:22:51 +0100 Subject: additional checks --- config/freeradius2/freeradius.inc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'config/freeradius2/freeradius.inc') diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 51029711..1af36665 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -3855,9 +3855,13 @@ function freeradius_motp_resync() { // check if disabled then we delete bash und otpverify.sh script if ($varsettings['varsettingsmotpenable'] == '') { - unlink("/usr/local/bin/otpverify.sh"); - exec("cd /var/db/pkg && pkg_delete `ls | grep bash`"); - log_error('FreeRADIUS: Uninstalling package "bash-4.1.7" which comes with Mobile-One-Time-Password (motp) if not already done.'); + if (file_exists("/usr/local/bin/otpverify.sh")) { + unlink("/usr/local/bin/otpverify.sh"); + } + if (exec("cd /var/db/pkg && ls | grep bash") == "bash-4.1.7") { + exec("cd /var/db/pkg && pkg_delete `ls | grep bash`"); + log_error('FreeRADIUS: Uninstalling package "bash-4.1.7" which comes with Mobile-One-Time-Password (motp).'); + } } // check if enabled then we need to download "bash" -- cgit v1.2.3