diff options
-rw-r--r-- | src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm index c30ec5dc..07630fcb 100644 --- a/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm +++ b/src/os-plugins/plugins/sysrqshutdown/OpenSLX/OSPlugin/sysrqshutdown.pm @@ -70,23 +70,20 @@ sub installationPhase { my $self = shift; my $info = shift; - my $openslxBasePath = $info->{'openslx-base-path'}; - my $pluginName = $self->{'name'}; + my $openslxBasePath = $info->{'openslx-base-path'}; + my $pluginName = $self->{'name'}; my $pluginBasePath = "$openslxBasePath/lib/plugins/$pluginName/files"; + my $pluginDirPath = "/opt/openslx/plugin-repo/$pluginName"; # copy files if (! -e "/sbin/shutdown.slxorig") { system("mv /sbin/shutdown /sbin/shutdown.slxorig"); - system("cp -p $pluginBasePath/shutdown /sbin/; - cp -p $pluginBasePath/shutdown $pluginBasePath/sysrqshutdown.sh \ - /opt/openslx/plugin-repo/$pluginName"); - chmod 0755, "/sbin/shutdown"; - } - # else assume reinstall - elsif (-e "/sbin/shutdown.slxorig") { - system("cp -p $pluginBasePath/shutdown /sbin/"); - chmod 0755, "/sbin/shutdown"; } + system("cp -p $pluginBasePath/shutdown /sbin/; + cp -p $pluginBasePath/shutdown $pluginDirPath; + cp -p $pluginBasePath/sysrqshutdown.sh $pluginDirPath"); + chmod 0755, "/sbin/shutdown", "$pluginDirPath/shutdown", + "$pluginDirPath/sysrqshutdown.sh"; return; } |