diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
commit | 3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch) | |
tree | f87bd4a126b3a843858eb447e8fd5893c3ee3882 /scripts/embed-lua.sh | |
parent | Initial commit. (diff) | |
download | knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.tar.xz knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.zip |
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'scripts/embed-lua.sh')
-rwxr-xr-x | scripts/embed-lua.sh | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/embed-lua.sh b/scripts/embed-lua.sh new file mode 100755 index 0000000..80f6cba --- /dev/null +++ b/scripts/embed-lua.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -e +# Clean unnecessary stuff from the lua file; note the significant tabulator. +alias strip="sed -e 's/^[ ]*//g; s/ */ /g; /^--/d; /^$/d'" +if command -v xxd > /dev/null 2>&1; then + strip < "$1" | xxd -i - +else + strip < "$1" | hexdump -v -e '/1 "0x%02X, " " "' +fi +exit $? |