Add stdin

This commit is contained in:
Vrganj 2021-01-16 18:41:41 +01:00
parent 8fd831982e
commit c537cab2da
30 changed files with 42 additions and 32 deletions

View file

@ -14,13 +14,15 @@ epoch=$(date +%s%N)
basepath="/var/lib/lxc/piston/rootfs"
filepath="/tmp/$epoch/code.code"
argpath="/tmp/$epoch/args.args"
stdinpath="/tmp/$epoch/stdin.stdin"
arg=$(basename $argpath)
# write arg file
mkdir -p $basepath/tmp/$epoch
chmod 777 $basepath/tmp/$epoch
cat $2 > $basepath$filepath
echo "${@:3}" > $basepath$argpath
cat $3 > $basepath$argpath
echo "${@:4}" > $basepath$argpath
# process incrementor
exec 200>$dir/lockfile