This repository has been archived by the owner. It is now read-only.
Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (16 sloc) 334 Bytes
prog=$1
uid=$2
if [ -z $1 ]; then
echo "you must provide a file"
exit 1
fi
if [ -z $uid ]; then
uid=10000
fi
echo "127.0.0.1 $(hostname)" >> /etc/hosts
groupadd code
useradd -u "$uid" -G code -d "/home/codecube" -m codecube
chgrp code /code
chmod 0775 /code
cd /home/codecube
sudo -u codecube /bin/bash /run-code.sh $prog