diff --git a/js/linux-power-management.js b/js/linux-power-management.js index 6be4eb7..51aa79c 100644 --- a/js/linux-power-management.js +++ b/js/linux-power-management.js @@ -1,7 +1,21 @@ +/* + Copyright 2019-2022 Michael Pozhidaev + This file is part of LUWRAIN. + + LUWRAIN is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. + + LUWRAIN is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. +*/ Luwrain.addCommand("poweroff", ()=>{ - Linux.runAsync("sudo systemctl poweroff"); + Linux.runAsync("if [ -e /cdrom/casper/filesystem.squashfs ]; then sudo poweroff --force; else sudo systemctl poweroff; fi"); }); Luwrain.addCommand("reboot", ()=>{