"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "postinst.pl" between
Ocsinventory-Unix-Agent-2.6.1.tar.gz and Ocsinventory-Unix-Agent-2.8.0.tar.gz

About: Ocsinventory-Agent is a Linux agent for OCS Inventory NG.

postinst.pl  (Ocsinventory-Unix-Agent-2.6.1):postinst.pl  (Ocsinventory-Unix-Agent-2.8.0)
skipping to change at line 63 skipping to change at line 63
$config->{debug} = 1; $config->{debug} = 1;
} elsif($option=~/--logfile=(\S*)$/){ } elsif($option=~/--logfile=(\S*)$/){
$config->{logfile} = $1; $config->{logfile} = $1;
} elsif($option=~/--nossl$/){ } elsif($option=~/--nossl$/){
$nossl = 1; $nossl = 1;
} elsif($option=~/--ca=(\S*)$/){ } elsif($option=~/--ca=(\S*)$/){
$config->{ca} = $1; $config->{ca} = $1;
} elsif($option=~/--download$/){ } elsif($option=~/--download$/){
$download = 1; $download = 1;
} elsif($option=~/--snmp$/){ } elsif($option=~/--snmp$/){
$snmp = 1; $config->{snmp} = 1;
} elsif($option=~/--now$/){ } elsif($option=~/--now$/){
$now = 1; $now = 1;
} elsif($option=~/--help/ || $option=~/-h/) { } elsif($option=~/--help/ || $option=~/-h/) {
print STDERR <<EOF; print STDERR <<EOF;
Usage : Usage :
\t--nowizard launch this script without interaction \t--nowizard launch this script without interaction
\t--server=url set OCS Inventory NG server address (e.g: http:/ /ocsinventory-ng/ocsinventory) \t--server=url set OCS Inventory NG server address (e.g: http:/ /ocsinventory-ng/ocsinventory)
\t--basevardir=path set OCS Inventory NG Unix Unified agent variable s directory (e.g: /var/lib/ocsinventory-agent) \t--basevardir=path set OCS Inventory NG Unix Unified agent variable s directory (e.g: /var/lib/ocsinventory-agent)
\t--configdir=path set OCS Inventory NG Unix Unified configuration directory (e.g: /etc/ocsinventory-agent) \t--configdir=path set OCS Inventory NG Unix Unified configuration directory (e.g: /etc/ocsinventory-agent)
\t--user=username set username for OCS Inventory server Apache aut hentication (if needed) \t--user=username set username for OCS Inventory server Apache aut hentication (if needed)
skipping to change at line 161 skipping to change at line 161
close CONFIG; close CONFIG;
} }
#Getting server name #Getting server name
print "[info] The config file will be written in $configdir/ocsinventory-age nt.cfg,\n"; print "[info] The config file will be written in $configdir/ocsinventory-age nt.cfg,\n";
$config->{server} = promptUser('What is the address of your ocs server',$con fig->{server}); $config->{server} = promptUser('What is the address of your ocs server',$con fig->{server});
#$config->{server} = promptUser('What is the address of your ocs server', ex ists ($config->{server})?$config->{server}:'ocsinventory-ng'); #$config->{server} = promptUser('What is the address of your ocs server', ex ists ($config->{server})?$config->{server}:'ocsinventory-ng');
#Getting credentials if needed #Getting credentials if needed
if (ask_yn ("Do you need credential for the server? (You probably don't)", ' n')) { if (ask_yn ("Do you need credential for the server? (You probably don't)", ' n')) {
$config->{user} = promptUser("user", $config->{user}; $config->{user} = promptUser("user", $config->{user});
$config->{user} = MIME::Base64::encode_base64($config->{user}); $config->{user} = MIME::Base64::encode_base64($config->{user});
$config->{password} = promptUser("password"); $config->{password} = promptUser("password");
$config->{password} = MIME::Base64::encode_base64($config->{password}); $config->{password} = MIME::Base64::encode_base64($config->{password});
print "[info] The realm can be found in the login popup of your Internet browser.\n[info] In general, it's something like 'Restricted Area'.\n"; print "[info] The realm can be found in the login popup of your Internet browser.\n[info] In general, it's something like 'Restricted Area'.\n";
$config->{realm} = promptUser("realm"); $config->{realm} = promptUser("realm");
} }
#Getting tag #Getting tag
unless ($config->{tag}){ unless ($config->{tag}){
if (ask_yn('Do you want to apply an administrative tag on this machine', 'y')) { if (ask_yn('Do you want to apply an administrative tag on this machine', 'y')) {
skipping to change at line 225 skipping to change at line 225
unless ($config->{ca}) { unless ($config->{ca}) {
if (ask_yn("Do you want to set CA certificates file path ?", 'y')){ if (ask_yn("Do you want to set CA certificates file path ?", 'y')){
$config->{ca} = promptUser('Specify CA certificates file path', $con fig->{ca}, '^\/\w+', 'The location must begin with /'); $config->{ca} = promptUser('Specify CA certificates file path', $con fig->{ca}, '^\/\w+', 'The location must begin with /');
} }
} }
#Enable download feature ? #Enable download feature ?
$download = ask_yn("Do you want to use OCS-Inventory software deployment fea ture?", 'y') unless $download; $download = ask_yn("Do you want to use OCS-Inventory software deployment fea ture?", 'y') unless $download;
#Enable SNMP feature ? #Enable SNMP feature ?
$snmp = ask_yn("Do you want to use OCS-Inventory SNMP scans feature?", 'y') unless $snmp; $config->{snmp} = ask_yn("Do you want to use OCS-Inventory SNMP scans featur e?", 'y') unless $config->{snmp};
#Run agent after configuration ? #Run agent after configuration ?
$now = ask_yn("Do you want to send an inventory of this machine?", 'y') unle ss $now; $now = ask_yn("Do you want to send an inventory of this machine?", 'y') unle ss $now;
} }
################ Here we go... ############## ################ Here we go... ##############
#Old unix agent #Old unix agent
if (-f $old_unix_agent_dir.'/ocsinv.conf' && $old_unix_config) { if (-f $old_unix_agent_dir.'/ocsinv.conf' && $old_unix_config) {
skipping to change at line 422 skipping to change at line 422
open MODULE, ">$configdir/modules.conf" or die "Can't write modules.conf in $con figdir: ".$!; open MODULE, ">$configdir/modules.conf" or die "Can't write modules.conf in $con figdir: ".$!;
print MODULE "# this list of module will be load by the at run time\n"; print MODULE "# this list of module will be load by the at run time\n";
print MODULE "# to check its syntax do:\n"; print MODULE "# to check its syntax do:\n";
print MODULE "# #perl modules.conf\n"; print MODULE "# #perl modules.conf\n";
print MODULE "# You must have NO error. Else the content will be ignored\n"; print MODULE "# You must have NO error. Else the content will be ignored\n";
print MODULE "# This mechanism goal is to launch agent extension modules\n"; print MODULE "# This mechanism goal is to launch agent extension modules\n";
print MODULE "\n"; print MODULE "\n";
print MODULE ($download?'':'#'); print MODULE ($download?'':'#');
print MODULE "use Ocsinventory::Agent::Modules::Download;\n"; print MODULE "use Ocsinventory::Agent::Modules::Download;\n";
print MODULE ($snmp?'':'#'); print MODULE ($config->{snmp}?'':'#');
print MODULE "use Ocsinventory::Agent::Modules::Snmp;\n"; print MODULE "use Ocsinventory::Agent::Modules::SnmpScan;\n";
print MODULE "\n"; print MODULE "\n";
print MODULE "# DO NOT REMOVE THE 1;\n"; print MODULE "# DO NOT REMOVE THE 1;\n";
print MODULE "1;\n"; print MODULE "1;\n";
close MODULE; close MODULE;
#Prevent security risks by removing existing snmp_com.txt file which is no longe r used #Prevent security risks by removing existing snmp_com.txt file which is no longe r used
my $snmp_com_file = "$snmpdir/snmp_com.txt"; my $snmp_com_file = "$snmpdir/snmp_com.txt";
if ( -f $snmp_com_file ) { if ( -f $snmp_com_file ) {
print STDERR "$snmp_com_file seems to exists...removing it to prevent securi ty risks !\n"; print STDERR "$snmp_com_file seems to exists...removing it to prevent securi ty risks !\n";
unlink $snmp_com_file; unlink $snmp_com_file;
 End of changes. 4 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)