소스 검색

Modified script to prompt user for details like repo name, user name etc..

pull/16/head
pavanendar 1 년 전
부모
커밋
bfc4e6a291
1개의 변경된 파일39개의 추가작업 그리고 16개의 파일을 삭제
  1. 39
    16
      i.lin.sh

+ 39
- 16
i.lin.sh 파일 보기

@@ -1,17 +1,31 @@
#!/bin/bash

# PB : TODO -- Prompt if not passed in.
REPOSERVER=http://git.bbh
DEFAULTREPOOWNER=chess
echo "Enter repo server URL:"
read reposervername
REPOSERVER=$reposervername
echo "Enter default repo owner:"
read defaultrepoownername
DEFAULTREPOOWNER=$defaultrepoownername
REPOOWNER=$DEFAULTREPOOWNER
INSTANCENAME=elixir
INSTANCETYPE=dev
GITUSER=pb
GITEMAIL=pradeep@bbh.org.in

echo "Enter instance name"
read instancename
INSTANCENAME=$instancename
echo "Enter instance type:"
read instancetypename
INSTANCETYPE=$instancetypename
echo "Enter Git user name:"
read GITUSERID
GITUSER=$GITUSERID
echo "Enter Git user email:"
read GITEMAILID
GITEMAIL=$GITEMAILID

# If $GITUSER = {{"git user id"}} then set $GITUSER = $USER # TODO : pavanendar -- read from user input default as login user.

#OPTIONS
SKIPPREREQS=true
SKIPDEVPREREQS=true
SKIPPREREQS=false
SKIPDEVPREREQS=false

if [ "$SKIPPREREQS" = "true" ]; then
echo "skipping prereqs for firstrun"
@@ -27,11 +41,13 @@
# Install prerequisites for dev environment
sudo apt install git
git config --global user.name "$GITUSER"
git config --global user.email "$GITEMAIL"
git config --global credential.helper store
git clone $REPOSERVER/$REPOOWNER/bbhverse
#git config --global credential.helper 'store --file ~/.git-credentials'
#echo "Enter git username: "
#read gitUser
#git config --global user.name '${gitUser}'
# git config --global user.name '${gitUser}'
#echo "username=$gitUser" >> ~/.git-credentials
#echo "Enter git password: "
#read gitPassword
@@ -98,9 +114,12 @@

sudo mkdir -p /var/chess
sudo chown $USER:$USER /var/chess
mkdir -p /var/chess/$INSTANCENAME
sudo chown $USER:$USER /var/chess/$INSTANCENAME
ROOT=/var/chess/$INSTANCENAME/$INSTANCETYPE
echo $ROOT
sudo mkdir -p $ROOT
mkdir -p $ROOT
sudo chown $USER:$USER $ROOT
cd $ROOT

git clone $REPOSERVER/$REPOOWNER/elxr.git
@@ -112,8 +131,13 @@

# Install mysql
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_lower_case_table_names
sudo debconf-set-selections <<< "mysql-server mysql-server/lowercase-table-names select Enabled"
#sudo apt install mysql-server -y
# sudo debconf-set-selections < "mysql-server mysql-server/lowercase-table-names select Enabled"

sudo debconf-set-selections <<EOF
mysql-server mysql-server/lowercase-table-names select Enabled
EOF
sudo debconf-show mysql-server
sudo apt install mysql-server -y
systemctl is-active mysql
#sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'mysql#minA1';"
#sudo mysql_secure_installation
@@ -135,5 +159,4 @@

echo module.exports = { instanceName : "'$INSTANCENAME'", reposerver: "'$REPOSERVER'", gitUser: "'$GITUSER'", gitEmail:"'$GITEMAIL'" } > installchoices.js
elxr use elixir
elxr i

elxr i

Loading…
취소
저장