forked from jutge-org/jutge-server-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjutge-install-sudo-tools
executable file
·28 lines (20 loc) · 1.11 KB
/
jutge-install-sudo-tools
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
28
#!/usr/bin/env bash
# This script is meant to be used inside the container
# in order to install the latest version of jutge-vinga
# and jutge-somhi.
if [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then
echo "This script installs the latest version of jutge-vinga and jutge-somhi."
exit 0
fi
sudo wget -O /usr/local/bin/jutge-vinga https://github.com/jutge-org/jutge-vinga-bin/raw/master/jutge-vinga-linux
sudo wget -O /usr/local/bin/jutge-somhi https://raw.githubusercontent.com/jutge-org/jutge-server-toolkit/master/scripts/jutge-somhi
sudo chown root:root /usr/local/bin/jutge-vinga
sudo chmod 700 /usr/local/bin/jutge-vinga
sudo chmod u+s /usr/local/bin/jutge-vinga
sudo chown root:root /usr/local/bin/jutge-somhi
sudo chmod 700 /usr/local/bin/jutge-somhi
sudo chmod u+s /usr/local/bin/jutge-somhi
ls -la /usr/local/bin/jutge-vinga
ls -la /usr/local/bin/jutge-somhi
echo "worker ALL=(ALL) NOPASSWD: /usr/local/bin/jutge-vinga" | (sudo su -c 'EDITOR="tee -a" visudo -f /etc/sudoers.d/worker')
echo "worker ALL=(ALL) NOPASSWD: /usr/local/bin/jutge-somhi" | (sudo su -c 'EDITOR="tee -a" visudo -f /etc/sudoers.d/worker')