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
hello.uu
bundle bundle
output output
bundle: hello.uu shellscript bundle: hello shellscript
cat shellscript hello.uu > bundle awk '{if ($$0 == "INSERT BINARY HERE") {system("uuencode -m hello output")} else {print $$0}}' shellscript > bundle
chmod 755 bundle chmod +x bundle
hello.uu: hello
uuencode hello output > hello.uu
hello: hello.c hello: hello.c
gcc -o hello hello.c gcc -o hello hello.c
#!/bin/sh #!/bin/sh
set -eu set -eu
uudecode "$0" uudecode << EOF
INSERT BINARY HERE
EOF
./output ./output
exit
...@@ -18,7 +18,6 @@ setup () { ...@@ -18,7 +18,6 @@ setup () {
} }
@test 'cat bundle | sh' { @test 'cat bundle | sh' {
skip "This will fail"
run sh -c 'cat bundle | sh' run sh -c 'cat bundle | sh'
[ "$output" = "Hello world." ] [ "$output" = "Hello world." ]
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment