diff options
author | Christian Hofmaier | 2021-03-16 20:03:58 +0100 |
---|---|---|
committer | Christian Hofmaier | 2021-03-16 20:03:58 +0100 |
commit | 834b95629832fc3735756727b6c7cb1826d0e9d8 (patch) | |
tree | ff465ef0063c59d92f8c77e89f15a2a7a2405977 /modules-available/rebootcontrol/install.inc.php | |
parent | [sysconfig] yes -> true (diff) | |
download | slx-admin-834b95629832fc3735756727b6c7cb1826d0e9d8.tar.gz slx-admin-834b95629832fc3735756727b6c7cb1826d0e9d8.tar.xz slx-admin-834b95629832fc3735756727b6c7cb1826d0e9d8.zip |
[rebootcontrol] Handle scheduler overlaps
- Overlaps < 5 min are ignored, < 15 triggers reboot
- Database: Make 1 line out of 2
Diffstat (limited to 'modules-available/rebootcontrol/install.inc.php')
-rw-r--r-- | modules-available/rebootcontrol/install.inc.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/modules-available/rebootcontrol/install.inc.php b/modules-available/rebootcontrol/install.inc.php index 7d4382d0..008d26aa 100644 --- a/modules-available/rebootcontrol/install.inc.php +++ b/modules-available/rebootcontrol/install.inc.php @@ -55,4 +55,13 @@ $output[] = tableAddConstraint('reboot_subnet_x_subnet', 'dstid', 'reboot_subnet $output[] = tableAddConstraint('reboot_scheduler', 'locationid', 'location', 'locationid', 'ON UPDATE CASCADE ON DELETE CASCADE'); +if (tableExists('reboot_scheduler')) { + Database::exec("ALTER TABLE `reboot_scheduler` DROP PRIMARY KEY , ADD PRIMARY KEY (`locationid`)"); +} +if (tableHasColumn('reboot_scheduler', 'action')) { + Database::exec("ALTER TABLE `reboot_scheduler` MODIFY COLUMN `action` ENUM('wol', 'sd', 'rb')"); +} + + + responseFromArray($output);
\ No newline at end of file |