--- packetfence/bin/pfcmd_vlan	2012-07-10 17:48:17.950381000 +0300
+++ wcc/packetfence/bin/pfcmd_vlan	2012-07-22 10:16:51.520406000 +0300
@@ -488,22 +488,28 @@
     my $macUndefOrEmpty     = (!defined($mac) || $mac eq '');
     my $ifIndexUndefOrEmpty = (!defined($ifIndex) || $ifIndex == 0);
     if ($macUndefOrEmpty && $ifIndexUndefOrEmpty) {
-        pod2usage("Please provide a MAC for wireless 802.1x or an ifIndex for wired 802.1x");
+        pod2usage(-message => "Please provide a MAC for wireless 802.1x or an ifIndex for wired 802.1x"
+                  -exitval => 1);
     }
     if ($switchDescRegExp eq '') {
-        pod2usage("the switch argument is necessary");
+        pod2usage(-message => "the switch argument is necessary"
+                  -exitval => 1);
     }
     if (!exists( $switchFactory->{_config}{$switchDescRegExp})) {
-        pod2usage("unknown switch $switchDescRegExp");
+        pod2usage(-message => "unknown switch $switchDescRegExp"
+                  -exitval => 1);
     }
     my $switch = $switchFactory->instantiate($switchDescRegExp);
     if (!$switch) {
         print "Can not instantiate switch $switchDescRegExp ! See log files for details\n";
+        exit 1;
     } else {
         $logger->debug("start handling 'deauthenticateDot1x' command");
         if (defined($mac) && $mac ne '') {
             $logger->info("wireless deauthentication of a 802.1x MAC");
-            $switch->deauthenticateMac($mac, 1);
+            if ( $switch->deauthenticateMac($mac, 1) != $TRUE ) {
+                exit 1;
+            }
         } elsif (defined($ifIndex) && $ifIndex != 0) {
             $logger->info("wired deauthentication of a 802.1x MAC");
             $switch->dot1xPortReauthenticate($ifIndex);
