blob: 21ecbc64101cee33b80813193bff6d15bdcd0375 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/bin/bash
if [ "$1" != "" ]; then
mkdir -p /root/submissions
chown root /root/submissions
chmod 700 /root/submissions
nom=/root/submissions/`date +%s%N`.bocarun
cp "$1" "$nom"
echo "dateerr=`date +%s`" >> "$nom"
uniq=`date +%sN`-`sha256sum "$1"`
uniq=`echo $uniq | sha256sum - | cut -f1 -d' '`
code=`cat /root/submissions/code`
res=`echo -n "${code}${uniq}${dateerr}" | sha256sum - | cut -f1 -d' '`
echo "uniq=$uniq" >> "$nom"
echo "code=$res" >> "$nom"
fi
|