add install script

This commit is contained in:
Guillermo Roche 2020-06-02 00:29:57 +02:00
parent fda48edaf0
commit c85cb24277

20
instaler_server.sh Normal file
View File

@ -0,0 +1,20 @@
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/