This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Install Sentora automatically using bash script
#1
[Not Solved] Install Sentora automatically using bash script
Hello,

When i am using this below code. it asking me a lot of inputs like timezone, location, public ip, hostname, etc etc. I want to make automatic installed with default value for inputs. So, my client can install sentora on there server by one click.

Code:
bash <(curl -L -Ss http://sentora.org/install)

I made a code like

With Expect :

Code:
#!/usr/bin/expect -f

# Install expect if not already installed
sudo yum -y install expect

# Define default values for Sentora installation
set timeout -1
set defaultValues {
    "3"            # Language: English
    "Asia/Kolkata"  # Timezone: Asia/Kolkata
    "your-name"    # Your name
    "admin@example.com" # Email address
    "your-hostname" # Hostname
    "your-public-ip" # Public IP address
    "your-street"  # Street address
    "your-city"    # City
    "your-state"    # State
    "your-country"  # Country
    "your-zipcode"  # Zip code
}

spawn ./sentora_install.sh

expect "Select Language (0-6) [3]: "
send "$defaultValues\r"

expect "Enter a valid timezone [UTC]: "
send "$defaultValues\r"

expect "Please enter your name [your-name]: "
send "$defaultValues\r"

expect "Enter your email address [admin@example.com]: "
send "$defaultValues\r"

expect "Enter your hostname [your-hostname]: "
send "$defaultValues\r"

expect "Enter your public IP address [your-public-ip]: "
send "$defaultValues\r"

expect "Enter your street address [your-street]: "
send "$defaultValues\r"

expect "Enter your city [your-city]: "
send "$defaultValues\r"

expect "Enter your state [your-state]: "
send "$defaultValues\r"

expect "Enter your country [your-country]: "
send "$defaultValues\r"

expect "Enter your ZIP code [your-zipcode]: "
send "$defaultValues\r"

expect eof

# Uninstall expect
sudo yum -y remove expect

echo "Sentora installation completed successfully."

Code 2 :

Code:
#!/bin/bash

# Install required dependencies
sudo yum -y install wget perl

# Download Sentora installation script
wget http://sentora.org/install -O sentora_install.sh

# Make the script executable
chmod +x sentora_install.sh

# Define default values for Sentora installation
defaultLanguage=3
defaultTimezone="Asia/Kolkata"
defaultName="your-name"
defaultEmail="admin@example.com"
defaultHostname="your-hostname"
defaultPublicIP="your-public-ip"
defaultStreet="your-street"
defaultCity="your-city"
defaultState="your-state"
defaultCountry="your-country"
defaultZipcode="your-zipcode"

# Run the Sentora installation script with default values
sudo ./sentora_install.sh <<EOF
$defaultLanguage
$defaultTimezone
$defaultName
$defaultEmail
$defaultHostname
$defaultPublicIP
$defaultStreet
$defaultCity
$defaultState
$defaultCountry
$defaultZipcode
EOF

# Clean up installation files
rm sentora_install.sh

echo "Sentora installation completed successfully."


I don't know what mistake, i am doing but it not working
Reply
Thanks given by:


Messages In This Thread
Install Sentora automatically using bash script - by servermaster - 05-19-2023, 08:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
SMTPTLS port 587 Close after fresh Install franmm25 6 1 ,974 10-23-2024, 09:33 PM
Last Post: Ekwadorin23
\debian 12 install sript? kevwebbie 1 563 08-20-2024, 07:45 AM
Last Post: TGates
Problem Install Sentora 2.0.1 franmm25 11 3 ,705 06-24-2024, 10:53 AM
Last Post: TGates

Forum Jump:


Users browsing this thread: 2 Guest(s)