The following instructions require Lucet, although they can be easily adapted to other WebAssembly runtimes.
Save the following script as /opt/lucet/bin/lucet-ondemand
:
#! /bin/sh
wasm_file="$1"
if [ -n "$wasm_file" ]; then
if od -x "$wasm_file" | head -n1 | grep -Fq '0000000 6100 6d73 0001'; then