Skip to content

Commit

Permalink
Poweroff for LiveCD
Browse files Browse the repository at this point in the history
  • Loading branch information
marigostra committed Jan 9, 2022
1 parent 8b704d7 commit 17557ae
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion js/linux-power-management.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
/*
Copyright 2019-2022 Michael Pozhidaev <[email protected]>
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", ()=>{
Expand Down

0 comments on commit 17557ae

Please sign in to comment.