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:
#2
[Not Solved] RE: Install Sentora automatically using bash script
That's not really how Sentora works.

You need to input Hostname and IP manually.
***Retail***
SCPH-39002, Running FCMB, HDD-OSD, Mini-OPL.
SCPH-30002 RSW (Automobile Collection Snow White)
SCPH-10000 x2
SCPH-15000
SCPH-18000 x2
DESR-7700
SCPH-2040X x2
Linux Kit
PSBBN V0.20, V0.30
HDD Utility V1.00, V1.01

***Dev***
DTL-H30102 Running FCMB, HDD-OSD, Mini-OPL.
DTL-H20400 - Boxed
Reply
Thanks given by:
#3
[Not Solved] RE: Install Sentora automatically using bash script
(05-23-2023, 06:04 PM)Nigel Wrote: That's not really how Sentora works.

You need to input Hostname and IP manually.

He is correct. You can not use generic entries. They must be populated with active server IP, proper (and active) panel domain and email, etc. Unless you are having the client fill out a form to do this, which in effect is the same as doing a normal install anyways, which I remind you is required to be done as ROOT user. Install will fail if not done as root user.

The install process has been made as simple as possible from the start.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by: Nigel
#4
[Not Solved] RE: Install Sentora automatically using bash script
(05-24-2023, 04:07 AM)TGates Wrote: I remind you is required to be done as ROOT user.


Yes, i have a root access.


(05-24-2023, 04:07 AM)TGates Wrote: They must be populated with active server IP, proper (and active) panel domain and email, etc. Unless you are having the client fill out a form to do this.


Yes, client fill hostname, IP, email ID in form.
Reply
Thanks given by:
#5
[Not Solved] RE: Install Sentora automatically using bash script
This isn't really a Sentora question. This is about your custom installer. I'm not sure how much I can help with that. But, more information is needed. What doesn't work? Does the script start? Does it lock up at some point? Are the answers being passed to the questions?
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
Thanks given by:


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: 5 Guest(s)