Skip to content

Commit 28253b2

Browse files
committed
add toggles
1 parent 12e6459 commit 28253b2

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,14 +104,23 @@ or placed in a file `~/.callhostrc` (automatically detected and sourced by `call
104104
```bash
105105
export CALL_HOST_STATUS=${CALL_HOST_STATUS:=disable}
106106
```
107-
Then to enable it temporarily:
107+
Use the dedicated toggle to enable it for the rest of your session (or until another toggle is called):
108+
```bash
109+
call_host_enable
110+
```
111+
or just enable it for one container invocation:
108112
```bash
109113
CALL_HOST_STATUS=enable cmssw-el7 ...
110114
```
111-
* Instead, if you have this enabled by default and you want to temporarily disable this for a specific container invocation:
115+
* Instead, if you have this enabled by default and want to disable it on the fly:
116+
Use the dedicated toggle to disable it for the rest of your session (or until another toggle is called):
117+
```bash
118+
call_host_disable
119+
```
120+
or just disable it for one container invocation:
112121
```bash
113122
CALL_HOST_STATUS=disable cmssw-el7 ...
114-
````
123+
```
115124

116125
### Caveats
117126

call_host.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ fi
4040
# ensure the pipe dir is bound
4141
export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${CALL_HOST_DIR}
4242

43+
# enable/disable toggles
44+
call_host_enable(){
45+
export CALL_HOST_STATUS=enable
46+
}
47+
export -f call_host_enable
48+
call_host_disable(){
49+
export CALL_HOST_STATUS=disable
50+
}
51+
export -f call_host_disable
52+
4353
# concept based on https://stackoverflow.com/questions/32163955/how-to-run-shell-script-on-host-from-docker-container
4454

4555
# execute command sent to host pipe; send output to container pipe; store exit code

0 commit comments

Comments
 (0)