From ad0de9615f04ed1e172e9bf8430857cb911d5fa3 Mon Sep 17 00:00:00 2001 From: Christian Poessinger <christian@poessinger.com> Date: Tue, 23 Apr 2019 12:55:32 +0200 Subject: T1345: fix Perl error when removing RADIUS configuration (cherry picked from commit ac13c77d7ddd607b32f5948560bfe41cb2dcd756) --- lib/Vyatta/Login/Radius.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/Login/Radius.pm b/lib/Vyatta/Login/Radius.pm index 53c92673..07da9d8c 100644 --- a/lib/Vyatta/Login/Radius.pm +++ b/lib/Vyatta/Login/Radius.pm @@ -39,8 +39,9 @@ sub remove_pam_radius { "pam-auth-update --package --remove radius") == 0 or die "pam-auth-update remove failed"; - unlink($PAM_RAD_AUTH) - or die "Can't remove $PAM_RAD_AUTH"; + if (-e $PAM_RAD_AUTH) { + unlink ($PAM_RAD_AUTH) or die "Can't remove $PAM_RAD_AUTH"; + } } sub add_pam_radius { -- cgit v1.2.3