-
Notifications
You must be signed in to change notification settings - Fork 9
/
lxcSetup.bash
27 lines (27 loc) · 886 Bytes
/
lxcSetup.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!bin/bash
container=judge1
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit 1
fi
apt-get install lxc-dev
if [ "$?" -ne 0 ]
then echo "*******Lxc package installation failed*********"
exit 1
fi
echo "*********Installing primary container, please be patient***********"
lxc-create -t ubuntu -n $container
chmod a+rwx /var/lib/lxc/$container
chmod a+rwx /var/lib/lxc/$container/rootfs
chmod a+rxw /var/lib/lxc/$container/rootfs/home/ubuntu/
cp -R Judge /var/lib/lxc/$container/rootfs/home/ubuntu/
cp firstSetup.bash startJudge.bash restart.bash .lxcmain.go /var/lib/lxc/$container/rootfs/home/ubuntu/
echo "********Open another terminal, run the following command******
*lxc-start -n $container
*lxc-console -n $container
*Username:ubuntu
*Password:ubuntu
*Recommended to change the default Password
*Setup root Password
*As root run script firstSetup.bash*********"
exit 0