Commit f1033f17 authored by Jean-Baptiste Petre's avatar Jean-Baptiste Petre

add script re6stnet install

parent 570efe65
#!/bin/bash
echo "install babel"
# extraction and deplacement rename in babeld
FILE=/root/babeld-1.3.4.tar.gz
if [ -e $FILE ]; then
echo "babeld-1.3.4.tar.gz already exists"
else
wget http://heberge-hd.net/slapos/babeld-1.3.4.tar.gz
fi
FILE=/root/babeld
if [ -e $FILE ];then
echo "already decompress"
cd /root/babeld
else
tar -zvxf babeld-1.3.4.tar.gz && mv babeld-1.3.4 babeld && cd /root/babeld
fi
# make and make install
FILE=/usr/local/bin/babeld
if [ -e $FILE ]; then
echo "babeld is already installed"
else
make
sleep 3
su -c 'make install'
fi
echo "download"
FILE=/usr/src/re6stnet
if [ -e $FILE ]; then
echo "git pull update"
cd /usr/src/re6stnet && git pull --rebase origin master
echo "done"
else
echo "the file does not exist"
cd /usr/src && git clone http://git.erp5.org/repos/re6stnet.git
echo "file exists now and download restnet"
fi
echo "file creation in re6stnet /etc/"
FILE=/etc/re6stnet
if [ -e $FILE ]; then
echo "the file exists"
else
echo "the file was created"
mkdir /etc/re6stnet
echo "done"
fi
echo "sign in anonymous"
FILE=/etc/re6stnet/ca.crt
if [ -e $FILE ]; then
echo "the file already exists"
else
cd /etc/re6stnet
/usr/src/re6stnet/re6st-conf --registry http://re6stnet.nexedi.com/ --anonymous -r title COMP-TESTE-JB-
echo 'recording made'
fi
echo "write config file re6stnet.conf"
FILE=/etc/re6stnet/re6stnet.conf
if [ -e $FILE ]; then
echo "file exists"
else
echo "registry http://re6stnet.nexedi.com/
ca ca.crt
cert cert.crt
key cert.key
dh dh2048.pem
table 0
ovpnlog
verbose 1
O--verb
O1" >> /etc/re6stnet/re6stnet.conf
echo "the file created"
fi
echo "write systemd unite"
FILE=/etc/systemd/system/re6stnet.service
if [ -e $FILE ]; then
echo "file exists"
else
echo "[Unit]
Description=Nexedi re6st network
[Service]
Type=simple
WorkingDirectory=/etc/re6stnet
ExecStart=/usr/src/re6stnet/re6stnet @re6stnet.conf
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target" >> /etc/systemd/system/re6stnet.service
echo "the file is create"
fi
echo "systemed enable and starting service"
systemctl --system daemon-reload
systemctl enable re6stnet.service
systemctl start re6stnet.service
sleep 50
echo "sleep 50"
echo "ping6 start go, option -c5"
ping6 -c 5 google.com
exit
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment