diff --git a/README.md b/README.md
index 1000d46..0bb9902 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,7 @@ sudo wget https://raw.githubusercontent.com/Yenthe666/InstallScript/13.0/odoo_in
##### 2. Modify the parameters as you wish.
There are a few things you can configure, this is the most used list:
```OE_USER``` will be the username for the system user.
+```GENERATE_RANDOM_PASSWORD``` if this is set to ```True``` the script will generate a random password, if set to ```False```we'll set the password that is configured in ```OE_SUPERADMIN```. By default the value is ```True``` and the script will generate a random and secure password.
```INSTALL_WKHTMLTOPDF``` set to ```False``` if you do not want to install Wkhtmltopdf, if you want to install it you should set it to ```True```.
```OE_PORT``` is the port where Odoo should run on, for example 8069.
```OE_VERSION``` is the Odoo version to install, for example ```13.0``` for Odoo V13.
diff --git a/odoo_install.sh b/odoo_install.sh
index 86c7967..7e519a4 100644
--- a/odoo_install.sh
+++ b/odoo_install.sh
@@ -27,8 +27,10 @@ OE_PORT="8069"
OE_VERSION="13.0"
# Set this to True if you want to install the Odoo enterprise version!
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"
+# 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"
##
@@ -143,6 +145,10 @@ echo -e "* Create server config file"
sudo touch /etc/${OE_CONFIG}.conf
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"
+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 '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"
@@ -247,6 +253,7 @@ echo "User service: $OE_USER"
echo "User PostgreSQL: $OE_USER"
echo "Code location: $OE_USER"
echo "Addons folder: $OE_USER/$OE_CONFIG/addons/"
+echo "Password superadmin (database): $OE_SUPERADMIN"
echo "Start Odoo service: sudo service $OE_CONFIG start"
echo "Stop Odoo service: sudo service $OE_CONFIG stop"
echo "Restart Odoo service: sudo service $OE_CONFIG restart"