Variable: executable-insert

Non-nil means offer to add a magic number to a file.
This takes effect when you switch to certain major modes,
including Shell-script mode (`sh-mode').
When you type M-x executable-set-magic, it always offers to add or
update the magic number.