diff --git a/lib/Nipe/Device.pm b/lib/Nipe/Device.pm index 4f147ba..ccf3d12 100644 --- a/lib/Nipe/Device.pm +++ b/lib/Nipe/Device.pm @@ -2,7 +2,7 @@ package Nipe::Device; -my $operationalSystem = `awk -F= '\$1=="ID" { print \$2 ;}' /etc/os-release`; +my $operationalSystem = `awk -F= '\$1=="ID_LIKE" { print \$2 ;}' /etc/os-release`; sub getUsername { my $username; @@ -15,7 +15,7 @@ sub getUsername { $username = "debian-tor"; } - elsif ($operationalSystem =~ /[F,f]edora/) { + elsif (($operationalSystem =~ /[F,f]edora/) || ($operationalSystem =~ /[C,c]entos/) ) { $username = "toranon"; } @@ -23,10 +23,6 @@ sub getUsername { $username = "tor"; } - elsif ($operationalSystem =~ /[C,c]entos/) { - $username = "toranon"; - } - else { $username = "tor"; }