I have a shell script file ./bin/postactivate
with following content:
#!/bin/sh
export STATIC_ROOT="/webapps/tsango/static/"
export MEDIA_ROOT="/webapps/tsango/media/"
export DATABASE_NAME="tsango"
export DJANGO_SETTINGS_MODULE="tsango.settings.vagrant"
export DATABASE_PASSWORD="password"
export BROKER_URL="amqp://tsango:password@localhost/tsango"
export DATABASE_USER="tsango"
I execute it with sudo sh ./bin/postactivate
command. The command seems to run properly, i.e. no output from the command line.
However, when I use printenv
to see the list of environment variables, none of the variables of the script is set.
I'm probably missing something... Can you tell me what?
sh
to run it? You have a hash bash slash bin slash sh? Now set the execute bit, and you don't need to run it withsh
. – ctrl-alt-delor Feb 20 '20 at 19:47