Blame view
komodo-mkios-install.sh
808 Bytes
7fe30f1b1
|
1 |
#!/bin/bash |
bc851e628
|
2 |
if [ ! -f "/home/komodo/.ssh/id_rsa.pub" ]; then |
7fe30f1b1
|
3 4 |
echo "SSH-ID does not exist." echo "Please do ssh-keygen and do not forget to register it on gitlab." |
bc851e628
|
5 |
#exit 1 |
7fe30f1b1
|
6 7 8 9 10 11 12 13 14 15 |
fi read -p 'Cluster name (one word): ' clustername < /dev/tty if [ -z "$clustername" ]; then echo "Invalid clustername"; exit fi clustername=${clustername^^} read -p 'Modem port (eg: ttyUSB0): ' modemport < /dev/tty |
bc851e628
|
16 |
$modemport=`basename $modemport` |
7fe30f1b1
|
17 18 19 20 |
if [ -z "$modemport" ]; then echo "Invalid modemport"; exit fi |
bc851e628
|
21 |
exit |
7fe30f1b1
|
22 23 24 25 26 27 28 29 30 |
set -x sudo useradd komodo sudo usermod -a -G dialout komodo sudo -u komodo mkdir /home/komodo/gateways cd /home/komodo/gateways sudo -u komodo git clone git@gitlab.kodesumber.com:komodo/komodo-gw-mkios.git $modemport || exit 1 cd /home/komodo/gateway/$modemport || exit 1 sudo -u komodo npm install |