Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gui_bootmanager: add a 'sed' based patch method with less dependencies
- Loading branch information
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#! /bin/sh | ||
[ -z "$1" ] && printf "Missing name of file as parameter, the file will be changed in place.\n" 1>&2 && exit 1 | ||
! [ -f "$1" ] && printf "File '%s' not found.\n" "$1" 1>&2 && exit 1 | ||
sed -e " | ||
/^local savecookie/a\\ | ||
if box.post.linux_fs_start then\\ | ||
local linux_fs_start = string.gsub(box.post.linux_fs_start, \"'\", \"\")\\ | ||
local branding = string.gsub(box.post[linux_fs_start..\"_branding\"], \"'\", \"\")\\ | ||
os.execute(\"/usr/bin/gui_bootmanager switch_to '\"..linux_fs_start..\"' '\"..branding..\"'\")\\ | ||
end | ||
/^<form action/a\\ | ||
<div id=\"managed_reboot\" class=\"reboot_managed\">\\ | ||
<?lua\\ | ||
pipe = io.popen(\"/usr/bin/gui_bootmanager html_display\")\\ | ||
line = pipe:read(\"*a\")\\ | ||
pipe:close()\\ | ||
box.out(line)\\ | ||
?>\\ | ||
</div> | ||
" -i "$1" |