Permalink
Browse files

Use sudo instead of su

  • Loading branch information...
1 parent dc5a7c8 commit b5cc8468d0445d1910befb34ea723593e39deab5 @priteau priteau committed Feb 25, 2014
Showing with 7 additions and 5 deletions.
  1. +7 −5 plan/newuser/newuser.sh
@@ -6,12 +6,14 @@ source bootconf.json
cd /home/epu/phantom/sandbox/FG
if [ ! -f /home/epu/.ssh/id_rsa ]; then
- su epu sh -c "ssh-keygen -f /home/epu/.ssh/id_rsa -N ''"
+ sudo -E -H -u epu bash -c "ssh-keygen -f /home/epu/.ssh/id_rsa -N ''"
fi
-su epu sh -c "source /home/epu/app-venv/bin/activate && ./add_sites.sh"
-su epu sh -c "source /home/epu/app-venv/bin/activate && ./test_add_user.py $PHANTOM_USERNAME $PHANTOM_IAAS_ACCESS_KEY $PHANTOM_IAAS_SECRET_KEY"
-su epu sh -c "source /home/epu/app-venv/bin/activate && ./add_mysql_user.py $PHANTOM_USERNAME $PHANTOM_IAAS_ACCESS_KEY $PHANTOM_IAAS_SECRET_KEY /home/epu/phantom/phantomautoscale.yml"
+export PYTHON_EGG_CACHE=/tmp/python-eggs-epu
+sudo -E -H -u epu bash -c "source /home/epu/app-venv/bin/activate && ./add_sites.sh"
+sudo -E -H -u epu bash -c "source /home/epu/app-venv/bin/activate && ./test_add_user.py $PHANTOM_USERNAME $PHANTOM_IAAS_ACCESS_KEY $PHANTOM_IAAS_SECRET_KEY"
+sudo -E -H -u epu bash -c "source /home/epu/app-venv/bin/activate && ./add_mysql_user.py $PHANTOM_USERNAME $PHANTOM_IAAS_ACCESS_KEY $PHANTOM_IAAS_SECRET_KEY /home/epu/phantom/phantomautoscale.yml"
cd /home/epu/phantomweb
-su www-data sh -c "export PYTHON_EGG_CACHE=/tmp/python-eggs-www-data && ./bin/phantomweb-new-user.py $PHANTOM_USERNAME $PHANTOM_USER_EMAIL $PHANTOM_IAAS_ACCESS_KEY $PHANTOM_IAAS_SECRET_KEY"
+export PYTHON_EGG_CACHE=/tmp/python-eggs-www-data
+sudo -E -H -u www-data bash -c "./bin/phantomweb-new-user.py $PHANTOM_USERNAME $PHANTOM_USER_EMAIL $PHANTOM_IAAS_ACCESS_KEY $PHANTOM_IAAS_SECRET_KEY"

0 comments on commit b5cc846

Please sign in to comment.