[Not Solved]
Install Sentora automatically using bash script
05-19-2023, 08:42 PM
(This post was last modified: 05-19-2023, 09:00 PM by servermaster.)
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.
I made a code like
With Expect :
Code 2 :
I don't know what mistake, i am doing but it not working
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