Skip to content

Commit

Permalink
adjusts for CentOS and support others distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Oct 25, 2018
1 parent a045667 commit 711ad38
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/Nipe/Device.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -15,18 +15,14 @@ sub getUsername {
$username = "debian-tor";
}

elsif ($operationalSystem =~ /[F,f]edora/) {
elsif (($operationalSystem =~ /[F,f]edora/) || ($operationalSystem =~ /[C,c]entos/) ) {
$username = "toranon";
}

elsif ($operationalSystem =~ /[A,a]rch/) {
$username = "tor";
}

elsif ($operationalSystem =~ /[C,c]entos/) {
$username = "toranon";
}

else {
$username = "tor";
}
Expand Down

0 comments on commit 711ad38

Please sign in to comment.