Commit db7e8b78 authored by Simon Redman's avatar Simon Redman

Update python-sudo.sh to run a script in its same directory regardless of...

Update python-sudo.sh to run a script in its same directory regardless of where the script is called from
parent f49cf007
Pipeline #3065 failed with stages
in 30 seconds
#!/bin/bash
# Author: Simon Redman <sredman@cs.utah.edu>
# File Created: 18.06.2018
# Last Modified: Mon 18 Jun 2018 03:37:01 PM MDT
# Last Modified: Mon 25 Apr 2019
# Description: For ease of debugging, it is desirable to have a "fake"
# Python interpreter which runs with elevated permissions. This does that.
#
source env/bin/activate
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
source "${SCRIPTPATH}"/env/bin/activate
sudo $(which python) "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment