I want to run a script automatically after every grub-update. The script itself consists of a single line
sed -i 's/[\]"!Windows 2006[\]"/"!Windows 2006"/g' /boot/grub/grub.cfg
For this purpose, I edited the already existing file
to read as follows:
#!/bin/sh set -e sed -i 's/[\]"!Windows 2006[\]"/"!Windows 2006"/g' /boot/grub/grub.cfg
This, however doesn't seem to work and I can't figure out why.
touch /tmp/grubtestand run
update-grub. Is the file create?
/etc/grub.dare run as part of creating
grub.cfg. I doubt you can process that file while it is being created.
/usr/sbin/grub-mkconfigwhich it executes and add a simple
echocommand to each of the scripts, but they were not processed for some reason. Are those scripts cached somewhere so that the changes did not affect the executed commands or is anything in there that terminates the script before reaching the last line?
touch /tmp/grubtestworks just fine. @muru maybe you are right. do you guys have some alternative?
cp /boot/grub/grub.cfg /tmp/grub.cfg. So you can see what's inside the grub file after running sed.