Skip to content
Snippets Groups Projects
Commit 78801451 authored by nimrod's avatar nimrod
Browse files

Second implementation.

This is slightly more hackish, but offers more invocation options (the
main one being `curl http://host/bundle | sh`).
parent 4f4a4106
No related branches found
No related tags found
No related merge requests found
hello
hello.uu
bundle
output
bundle: hello.uu shellscript
cat shellscript hello.uu > bundle
chmod 755 bundle
hello.uu: hello
uuencode hello output > hello.uu
bundle: hello shellscript
awk '{if ($$0 == "INSERT BINARY HERE") {system("uuencode -m hello output")} else {print $$0}}' shellscript > bundle
chmod +x bundle
hello: hello.c
gcc -o hello hello.c
#!/bin/sh
set -eu
uudecode "$0"
uudecode << EOF
INSERT BINARY HERE
EOF
./output
exit
......@@ -18,7 +18,6 @@ setup () {
}
@test 'cat bundle | sh' {
skip "This will fail"
run sh -c 'cat bundle | sh'
[ "$output" = "Hello world." ]
[ "$status" -eq 0 ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment