Removed interactive install to only use .env now

This commit is contained in:
Derek Crudgington 2023-04-17 16:02:06 +00:00
parent 2f2c8270ba
commit 11c1932049
2 changed files with 14 additions and 24 deletions

View File

@ -1,17 +1,17 @@
# Domain name
#DOMAIN="test.com"
DOMAIN="test.com"
# Company name
#COMPANY="Fang Free Inc"
COMPANY="Fang Free Inc"
# Country
#COUNTRY="US"
# Country Code (US, HK, GB, JP, etc)
COUNTRY="US"
# Administrator password
#ADMINPASS="password123"
ADMINPASS="password123"
# Backblaze KeyID (Master Key)
# Backblaze KeyID (Master Key) for backups
B2_APPLICATION_KEY_ID="3239c6765fdc"
# Backblaze Application Key
# Backblaze Application Key for backups
B2_APPLICATION_KEY="0050ac8837466cbca0e0aa574b5f8332f706a5e26c"

View File

@ -46,24 +46,14 @@ get_config() {
[ -z "$COMPANY" ] && failcheck "/federated/bin/.env doesn't include COMPANY"
[ -z "$COUNTRY" ] && failcheck "/federated/bin/.env doesn't include COUNTRY"
[ -z "$ADMINPASS" ] && failcheck "/federated/bin/.env doesn't include ADMINPASS"
exit 2;
if ! printf '%s\0' "${COUNTRIES[@]}" | grep -Fxqz -- "$COUNTRY"; then
failcheck "$COUNTRY is not a valid country code. Use US, GB, HK, etc"
fi
[ -z "$B2_APPLICATION_KEY_ID" ] && echo -ne "\nWarning: B2_APPLICATION_KEY_ID doesn't exist in .env\nBackups will be disabled"
[ -z "$B2_APPLICATION_KEY" ] && echo -ne "\nWarning: B2_APPLICATION_KEY doesn't exist in .env\nBackups will be disabled"
else
echo -ne "\nFederated Stack install script\n\n"
read -p '* Enter domain name (domain.com): ' DOMAIN
read -p '* Enter company name (Domain Company): ' COMPANY
read -p '* Enter country code: ' COUNTRY
while [ true ]; do
if printf '%s\0' "${COUNTRIES[@]}" | grep -Fxqz -- "$COUNTRY"; then
break
else
read -p "* Invalid, choose a country code (US, GB, HK, etc): " COUNTRY
fi
done
read -sp '* Enter admin password to use for initial login: ' ADMINPASS
[ -z "$DOMAIN" ] && failcheck "Must enter a domain name"
[ -z "$COMPANY" ] && failcheck "Must enter a company name"
[ -z "$ADMINPASS" ] && failcheck "Must enter a admin password"
fi
failcheck "/federated/bin/.env doesn't exist"
fi
}
while getopts d OPTION; do