-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80abec4
commit 36f1850
Showing
11 changed files
with
162 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,7 +57,7 @@ my %defaultopt = ( | |
my $NAME = 'nivlheim_client'; | ||
my $AUTHOR = 'Øyvind Hagberg'; | ||
my $CONTACT = '[email protected]'; | ||
my $RIGHTS = 'USIT/IT-DRIFT/GD/GID, University of Oslo'; | ||
my $RIGHTS = 'USIT/IT-DRIFT/GD/GID, University of Oslo, Norway'; | ||
open(my $F, "/etc/nivlheim/version"); | ||
chomp(my $VERSION = <$F>); | ||
close($F); | ||
|
@@ -293,6 +293,21 @@ elsif ($have_cert && !$cert_works) { | |
# Determine which files to send | ||
my @filelist = keys %{$config{'files'}}; | ||
|
||
# Make sure essential files are on the list | ||
my @essentials = ( | ||
"/etc/redhat-release", | ||
"/etc/debian_version", | ||
"/etc/lsb-release", | ||
"/usr/lib/os.release.d/os-release-workstation", | ||
"/usr/lib/os.release.d/os-release-server", | ||
"/usr/lib/os.release.d/os-release-cloud" | ||
); | ||
foreach my $e (@essentials) { | ||
if (!grep {$e eq $_} @filelist) { | ||
push @filelist, $e; | ||
} | ||
} | ||
|
||
# Create tar archive | ||
my $tar = Archive::Tar->new(); | ||
|
||
|
@@ -312,8 +327,23 @@ for my $filename (@filelist) { | |
} | ||
} | ||
|
||
# Run all the commands, collect the output and store it | ||
# Get the list of commands | ||
my @cmdlist = keys %{$config{'commands'}}; | ||
|
||
# Make sure essential commands are on the list | ||
@essentials = ( | ||
"/bin/uname -a", | ||
"/usr/bin/dpkg-query -l", | ||
"/usr/bin/sw_vers", | ||
"/usr/sbin/dmidecode -t system" | ||
); | ||
foreach my $e (@essentials) { | ||
if (!grep {$e eq $_} @cmdlist) { | ||
push @cmdlist, $e; | ||
} | ||
} | ||
|
||
# Run all the commands, collect the output and store it | ||
foreach my $cmd (@cmdlist) { | ||
# if it got parsed erroneously and is split on /=/, re-assemble it | ||
if (defined($config{'commands'}{$cmd})) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
36f1850
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolves #25