summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f5defa2)
raw | patch | inline | side by side (parent: f5defa2)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 23 Feb 2010 09:45:02 +0000 (09:45 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 23 Feb 2010 09:45:02 +0000 (09:45 +0000) |
Use goto-action to trigger local si-client events
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15669 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@15669 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-si/client/events/gosaTriggered.pm | patch | blob | history |
diff --git a/trunk/gosa-si/client/events/gosaTriggered.pm b/trunk/gosa-si/client/events/gosaTriggered.pm
index dca6f63088b9a377e52069f3d6a7bfc076c4900a..ed19d312083cee6c4a816f4582209845049a6b31 100644 (file)
my ($msg, $msg_hash) = @_;
my $timeout;
- if((not exists $msg_hash->{timeout} ) || (1 != @{$msg_hash->{timeout}} ) ) {
- $timeout = 0;
- }
- else {
- $timeout = @{$msg_hash->{timeout}}[0];
- }
-
# check logged in user
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);
- }
- else {
- system( "/sbin/shutdown -r +$timeout &" );
}
+ open(FILE, "> /etc/gosa-si/event");
+ print FILE "reboot\n";
+ close(FILE);
+
+ system( "/usr/sbin/goto-action &" );
+
return;
}
my ($msg, $msg_hash) = @_;
my $timeout;
- if((not exists $msg_hash->{timeout} ) || (1 != @{$msg_hash->{timeout}} ) ) {
- $timeout = 0;
- }
- else {
- $timeout = @{$msg_hash->{timeout}}[0];
- }
-
# check logged in user
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);
- }
- else {
- system( "/sbin/shutdown -h +$timeout &" );
}
+ open(FILE, "> /etc/gosa-si/event");
+ print FILE "halt\n";
+ close(FILE);
+
+ system( "/usr/sbin/goto-action &" );
+
return;
}
print FILE "install\n";
close(FILE);
}
- else {
- system( "/sbin/shutdown -r now &" );
- }
+
+ system( "/usr/sbin/goto-action &" );
return;
}
sub trigger_action_update {
my ($msg, $msg_hash) = @_;
- # Execute update
- system( "DEBIAN_FRONTEND=noninteractive /usr/sbin/fai-softupdate &" );
+ # check logged in user
+ my @user_list = &get_logged_in_users;
+ if( @user_list >= 1 ) {
+ system( "/usr/bin/goto-notify softupdate" );
+ open(FILE, "> /etc/gosa-si/event");
+ print FILE "softupdate\n";
+ close(FILE);
+ }
+
+ system( "/usr/sbin/goto-action &" );
return;
}
sub trigger_action_instant_update {
my ($msg, $msg_hash) = @_;
- # Execute update
- system( "DEBIAN_FRONTEND=noninteractive /usr/sbin/fai-softupdate &" );
+ # check logged in user
+ my @user_list = &get_logged_in_users;
+ if( @user_list >= 1 ) {
+ system( "/usr/bin/goto-notify softupdate" );
+ open(FILE, "> /etc/gosa-si/event");
+ print FILE "softupdate\n";
+ close(FILE);
+ }
+
+ system( "/usr/sbin/goto-action &" );
return;
}