ghantoos / lshell

lshell is a shell coded in Python, that lets you restrict a user's environment to limited sets of commands, choose to enable/disable any command over SSH (e.g. SCP, SFTP, rsync, etc.), log user's commands, implement timing restriction, and more.
GNU General Public License v3.0
436 stars 111 forks source link

add source command to lshell #72

Open hostingnuggets opened 10 years ago

hostingnuggets commented 10 years ago

i would like my lshell users to use the virtualenv tool for hosting python, now this tool requires the user to source in a shell script using the "source" shell command as follows:

lshell$ source bin/activate

running this command simply returns:

sh: 1: source: not found

so I am guessing here that the source command is not implemented in lshell, could you implement it please? I think this is quite important to have.

jfucanada commented 9 years ago

There is one way to do this. You can create script to include all variables and run lshell in the end of script. It will source environmental variables with lshell. I know it's not convenient. But this could be the work around solution.

mhindery commented 9 years ago

The way I did this, was using the env_vars option in the config file:

env_vars : {'PATH':'VIRTUAL_ENV_DIRECTORY/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'}

This allows for a user working in the virtual environment.