Skip to content

Commit

Permalink
gui_bootmanager: add a 'sed' based patch method with less dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPawn committed Aug 18, 2018
1 parent 2f29803 commit 23eb877
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bootmanager/change_system_reboot_lua.sh
@@ -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"

0 comments on commit 23eb877

Please sign in to comment.