ServidorTFG/instaler_server.sh

21 lines
905 B
Bash
Raw Normal View History

2020-06-02 00:29:57 +02:00
echo Contraseña:
read -s pas
qmake -makefile ServidorTFG.pro && make -j$(nproc)
useradd remotebuilds
echo $pas | sudo -S mkdir /opt/serverRemoteBuilds
echo $pas | sudo -S mv ServidorTFG /opt/serverRemoteBuilds
echo $pas | sudo -S chown -R remotebuilds /opt/serverRemoteBuilds
echo $pas | sudo -S chmod a+w /etc/sudoers && echo "remotebuilds ALL=(ALL) ALL, NOPASSWD:/opt/serverRemoteBuilds" && sudo chmod a-w /etc/sudoers
echo $pas | sudo -S echo "security=yes" >> /opt/serverRemoteBuilds/config
echo "write a port to listen"
read port
echo $pas | sudo -S echo "port=$port" >> /opt/serverRemoteBuilds/config
echo "write a cert path"
read cert
echo $pas | sudo -S echo "cert=$cert" >> /opt/serverRemoteBuilds/config
echo "write a key path"
read key
echo $pas | sudo -S echo "key=$key" >> /opt/serverRemoteBuilds/config
mysql <installDB.sql> output.tab
echo $pas | sudo -S cp serverRemoteBuild /etc/init.d/