[ADD] odoo_install: generate random password

pull/197/head
Yenthe Van Ginneken 6 years ago committed by GitHub
parent 7f8fd7908e
commit 08dc707b94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -27,8 +27,10 @@ OE_PORT="8069"
OE_VERSION="13.0" OE_VERSION="13.0"
# Set this to True if you want to install the Odoo enterprise version! # Set this to True if you want to install the Odoo enterprise version!
IS_ENTERPRISE="False" IS_ENTERPRISE="False"
# set the superadmin password # Set the superadmin password - if GENERATE_RANDOM_PASSWORD is set to "True" we will automatically generate a random password, otherwise we use this one
OE_SUPERADMIN="admin" OE_SUPERADMIN="admin"
# Set to "True" to generate a random password, "False" to use the variable in OE_SUPERADMIN
GENERATE_RANDOM_PASSWORD="True"
OE_CONFIG="${OE_USER}-server" OE_CONFIG="${OE_USER}-server"
## ##
@ -143,6 +145,10 @@ echo -e "* Create server config file"
sudo touch /etc/${OE_CONFIG}.conf sudo touch /etc/${OE_CONFIG}.conf
echo -e "* Creating server config file" echo -e "* Creating server config file"
sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf" sudo su root -c "printf '[options] \n; This is the password that allows database operations:\n' >> /etc/${OE_CONFIG}.conf"
if [ $GENERATE_RANDOM_PASSWORD = "True" ]; then
echo -e "* Generating random admin password"
OE_SUPERADMIN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
fi
sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf" sudo su root -c "printf 'admin_passwd = ${OE_SUPERADMIN}\n' >> /etc/${OE_CONFIG}.conf"
sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf" sudo su root -c "printf 'xmlrpc_port = ${OE_PORT}\n' >> /etc/${OE_CONFIG}.conf"
sudo su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /etc/${OE_CONFIG}.conf" sudo su root -c "printf 'logfile = /var/log/${OE_USER}/${OE_CONFIG}.log\n' >> /etc/${OE_CONFIG}.conf"
@ -247,6 +253,7 @@ echo "User service: $OE_USER"
echo "User PostgreSQL: $OE_USER" echo "User PostgreSQL: $OE_USER"
echo "Code location: $OE_USER" echo "Code location: $OE_USER"
echo "Addons folder: $OE_USER/$OE_CONFIG/addons/" echo "Addons folder: $OE_USER/$OE_CONFIG/addons/"
echo "Password superadmin (database): $OE_SUPERADMIN"
echo "Start Odoo service: sudo service $OE_CONFIG start" echo "Start Odoo service: sudo service $OE_CONFIG start"
echo "Stop Odoo service: sudo service $OE_CONFIG stop" echo "Stop Odoo service: sudo service $OE_CONFIG stop"
echo "Restart Odoo service: sudo service $OE_CONFIG restart" echo "Restart Odoo service: sudo service $OE_CONFIG restart"

Loading…
Cancel
Save