Created
February 21, 2016 20:29
-
-
Save nathanpjones/61680827d180e930848d to your computer and use it in GitHub Desktop.
Run Python as Root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR=$(dirname $(readlink -f "${BASH_SOURCE}")) | |
if [ ! -f $DIR/venv/bin/python ]; then | |
echo "This script should be located in the project root directory" | |
echo "and the virtual environment should be created." | |
else | |
# Change python back to run as pi | |
sudo chown -v pi:pi "$DIR/venv/bin/python" | |
sudo chmod -v u-s "$DIR/venv/bin/python" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
DIR=$(dirname $(readlink -f "${BASH_SOURCE}")) | |
if [ ! -f $DIR/venv/bin/python ]; then | |
echo "This script should be located in the project root directory" | |
echo "and the virtual environment should be created." | |
else | |
# Change python to run as root | |
sudo chown -v root:root "$DIR/venv/bin/python" | |
sudo chmod -v u+s "$DIR/venv/bin/python" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment