summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <andy@groveronline.com>2018-03-16 09:23:11 -0700
committerGitHub <noreply@github.com>2018-03-16 09:23:11 -0700
commit3b5f06340e552da4e8fe350a6b0905ae937e54e9 (patch)
tree29e74404e89b21625014026ee2c2b3c926bd6e61
parentbfd8bdc06973072fae30953feb61a4a9b0262cad (diff)
parent31c46b99e61b6fcfbbc5b277b797cd83270688e4 (diff)
downloadtargetcli-3b5f06340e552da4e8fe350a6b0905ae937e54e9.tar.gz
Merge pull request #106 from avagin/homedir
Allow to customize a home directory
-rwxr-xr-xscripts/targetcli4
-rw-r--r--targetcli.83
2 files changed, 5 insertions, 2 deletions
diff --git a/scripts/targetcli b/scripts/targetcli
index 7c549e6..b042ad9 100755
--- a/scripts/targetcli
+++ b/scripts/targetcli
@@ -20,7 +20,7 @@ under the License.
from __future__ import print_function
-from os import getuid
+from os import getuid, getenv
from targetcli import UIRoot
from rtslib_fb import RTSLibError
from configshell_fb import ConfigShell, ExecutionError
@@ -75,7 +75,7 @@ def main():
else:
is_root = False
- shell = TargetCLI('~/.targetcli')
+ shell = TargetCLI(getenv("TARGETCLI_HOME", '~/.targetcli'))
try:
root_node = UIRoot(shell, as_root=is_root)
diff --git a/targetcli.8 b/targetcli.8
index 45ea3e3..61f4b64 100644
--- a/targetcli.8
+++ b/targetcli.8
@@ -456,6 +456,9 @@ the userid and password for full-feature phase for this ACL.
.B /etc/target/saveconfig.json
.br
.B /etc/target/backup/*
+.SH ENVIRONMENT
+.SS TARGETCLI_HOME
+If set, this variable points to a directory that should be used instead of ~/.targetctl
.SH SEE ALSO
.BR targetctl (8),
.BR tcmu-runner (8)