summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0612d89)
raw | patch | inline | side by side (parent: 0612d89)
author | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 27 Mar 2010 23:22:25 +0000 (23:22 +0000) | ||
committer | opensides <opensides@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Sat, 27 Mar 2010 23:22:25 +0000 (23:22 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17316 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-si/client/events/dak.pm | patch | blob | history | |
gosa-si/client/events/gosaTriggered.pm | patch | blob | history |
index c1566a8ee0d327dd1fce049da3f2a03636143f5a..57c2f85337f769dfd0f322f4ebe3e62310f26f09 100644 (file)
# @brief Implementation of a GOsa-SI-client event module.
package dak;
+
+use strict;
+use warnings;
use Exporter;
+
+use GOSA::GosaSupportDaemon;
+use MIME::Base64;
+
@ISA = qw(Exporter);
my @events = (
"get_events",
);
@EXPORT = @events;
-
-use strict;
-use warnings;
-use GOSA::GosaSupportDaemon;
-use MIME::Base64;
-
BEGIN {}
END {}
&add_content2xml_hash($out_hash, "error", "DAK Keyring is not writable");
} else {
my $keyfile;
- open($keyfile, ">/tmp/gosa_si_tmp_dak_key");
+ open($keyfile, ">","/tmp/gosa_si_tmp_dak_key");
print $keyfile $key;
close($keyfile);
my $command = "$gpg --import /tmp/gosa_si_tmp_dak_key";
index e73b69f7c1bc168dfa3ba5158a707eab7caea175..3b6f9678a23f141028684689f622d4b3d828451c 100644 (file)
package gosaTriggered;
+
+use strict;
+use warnings;
use Exporter;
+
+use GOSA::GosaSupportDaemon;
+use MIME::Base64;
+use File::Temp qw/ tempfile/;
+
@ISA = qw(Exporter);
my @events = (
"get_events",
);
@EXPORT = @events;
-use strict;
-use warnings;
-use GOSA::GosaSupportDaemon;
-use MIME::Base64;
-use File::Temp qw/ tempfile/;
-
BEGIN {}
END {}
# Check logged in user
my @user_list = &get_logged_in_users;
if( @user_list >= 1 ) {
- open(FILE, "> /etc/gosa-si/event");
- print FILE "trigger_action_localboot\n";
- close(FILE);
+ open($FILE, ">", "/etc/gosa-si/event");
+ print $FILE "trigger_action_localboot\n";
+ close($FILE);
}
}
else {
my @user_list = &get_logged_in_users;
if( @user_list >= 1 ) {
system( "/usr/bin/goto-notify reboot" );
- open(FILE, "> /etc/gosa-si/event");
- print FILE "reboot\n";
- close(FILE);
+ open($FILE, ">", "/etc/gosa-si/event");
+ print $FILE "reboot\n";
+ close($FILE);
}
}
else {
my @user_list = &get_logged_in_users;
if( @user_list >= 1 ) {
system( "/usr/bin/goto-notify halt" );
- open(FILE, "> /etc/gosa-si/event");
- print FILE "halt\n";
- close(FILE);
+ open($FILE, ">", "/etc/gosa-si/event");
+ print $FILE "halt\n";
+ close($FILE);
}
} else {
system( "/sbin/shutdown -h +$timeout &" );
my @user_list = &get_logged_in_users;
if( @user_list >= 1 ) {
system( "/usr/bin/goto-notify install" );
- open(FILE, "> /etc/gosa-si/event");
- print FILE "install\n";
- close(FILE);
+ open($FILE, ">", "/etc/gosa-si/event");
+ print $FILE "install\n";
+ close($FILE);
}
} else {
system( "/sbin/shutdown -r now &" );