Skip to content

Commit

Permalink
Merge pull request flexcomng#12 from Thatoo/patch-1
Browse files Browse the repository at this point in the history
remove expect and simplify site creation
  • Loading branch information
flexcomng authored Jan 2, 2024
2 parents 38067e2 + 7f00bda commit 0e8676c
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions erpnext_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,41 +331,14 @@ sleep 1
adminpasswrd=$(ask_twice "Enter the Administrator password" "true")
echo -e "\n"
sleep 2
# Install expect tool only if needed
echo $passwrd | sudo -S apt -qq install expect -y

echo -e "${YELLOW}Now setting up your site. This might take a few minutes. Please wait...${NC}"
sleep 1
# Change directory to frappe-bench
cd frappe-bench && \

sudo chmod -R o+rx /home/$(echo $USER)


# Create new site using expect
export SITE_NAME=$site_name
export SQL_PASSWD=$sqlpasswrd
export ADMIN_PASSWD=$adminpasswrd

#Set Administrator password.
SITE_SETUP=$(expect -c "
set timeout 300
set sitename \$env(SITE_NAME)
set sqlpwd \$env(SQL_PASSWD)
set adminpwd \$env(ADMIN_PASSWD)
spawn bench new-site \$sitename --install-app erpnext
expect \"MySQL root password:\"
send \"\$sqlpwd\r\"
expect \"Set Administrator password:\"
sleep 20
send \"\$adminpwd\r\"
expect \"Re-enter Administrator password:\"
sleep 20
send \"\$adminpwd\r\"
expect eof
")
echo "$SITE_SETUP"

bench new-site $site_name --db-root-password $sqlpasswrd --admin-password $adminpasswrd --install-app erpnext

echo -e "${LIGHT_BLUE}Would you like to continue with production install? (yes/no)${NC}"
read -p "Response: " continue_prod
Expand Down

0 comments on commit 0e8676c

Please sign in to comment.