Make it possible to override SecureCRT config path

This commit is contained in:
Davide Depau 2019-09-09 17:17:19 +02:00
parent 5634ae720f
commit 2e966378ca
Signed by: depau
GPG key ID: C7D999B6A55EFE86
2 changed files with 25 additions and 4 deletions

View file

@ -65,6 +65,15 @@ export emojis=YOUR_CHOIC
- `auto`: always display emojis on GNU/Linux, disabled on WSL because of crappy terminal
- `yes`, `no`: force enable/disable
### Custom SecureCRT config path
```bash
export crtconfig="/path/to/your/Config"
```
Overrides default SecureCRT config paths:
- GNU/Linux: `~/.vandyke/SecureCRT/Config`
- Windows: `%APPDATA%/VanDyke/Config` (⇒ usually `/mnt/c/Users/your.user/AppData/VanDyke/Config`)
## Bugs
I expect it to be full of bugs; so should you.

20
shcrt
View file

@ -18,6 +18,14 @@ source ~/.shcrtrc 2> /dev/null
## Emojis - auto, yes, no
export emojis="auto"
## Custom SecureCRT config path
# Set to override defaults:
# - GNU/Linux: ~/.vandyke/SecureCRT/Config
# - Windows: %APPDATA%/VanDyke/Config
# On WSL it needs to be a Linux path!
#export crtconfig="/your/path/to/Config"
########### /Script config #############
function is_wsl {
@ -76,11 +84,15 @@ function no_dollars {
}
function scrt_session_path {
if is_wsl; then
appdata="$(wsl_win_var '%APPDATA%' | win_path_to_wsl)"
echo "$appdata/VanDyke/Config/Sessions"
if [[ "$crtconfig" != "" ]]; then
echo "$crtconfig/Sessions"
else
echo "$HOME/.vandyke/SecureCRT/Config/Sessions"
if is_wsl; then
appdata="$(wsl_win_var '%APPDATA%' | win_path_to_wsl)"
echo "$appdata/VanDyke/Config/Sessions"
else
echo "$HOME/.vandyke/SecureCRT/Config/Sessions"
fi
fi
}