You are not logged in.
What exactly is a data needed for single connection? An example?
Offline
What exactly is a data needed for single connection? An example?
So far as I can tell, these are the only variables that I need to use.
host: schwim.net
user: schwim
local dir: /home/schwim/schwim.net
remote dir: /var/www/client1
Last edited by schwim (2020-11-23 15:08:31)
Schw.im! A social site with an identity crisis.
Offline
I'd probably try with an associative array, where key would be your label (server1) and value would be the entire command needed (sshfs + all the data needed) - unlike variables one should be able to expand an array value directly (without any evals).
In this direction
#!/bin/bash
# an array here
declare -A exe
exe=(
["serverOne"]="echo woot"
["job"]="sleep 3"
["myserv"]="neofetch"
)
# this is the exe
${exe[serverOne]}
${exe[job]}
${exe[myserv]}
p.s. Arrays in bash are a world of pain (only my experience), so be prepared to suffer.
Last edited by brontosaurusrex (2020-11-23 17:54:42)
Offline
"menuItem" is a variable used by BL and sourced from /usr/lib/bunsen/common/bl-includes.
You should have seen this in the existing BL pipemenus.
There are also some functions for jgmenu in the same file:
jgmenuItem
jgmenuSeparator
jgmenuSubmenu
jgmenuEnd
If you're creating a jgmenu pipe menu from scratch they can save you some work (but you seem to be there already).
You can see some examples of usage in /usr/bin/bl-scrot-pipemenu
...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )
Offline
Would something like this make sense?
# an array here
declare -A loop
loop=(
["serverOne"][domain]="domain.com"
["serverOne"][user]="bobthebuilder"
["serverOne"]["local"]="/home/schwim/Remote/SSHFS/domain.com"
["serverOne"]["remote"]="/var/www/client1"
["serverTwo"][domain]="anotherdomain.com"
["serverTwo"][user]="dougthedestroyer"
["serverTwo"]["local"]="/home/schwim/Remote/SSHFS/anotherdomain.com"
["serverTwo"]["remote"]="/home/doug/www"
)
? Does bash work this way? If this is feasible, how might I go about looping through that array in the script to get to the important bits?
Schw.im! A social site with an identity crisis.
Offline
^Not a valid bash array of any sort. https://www.shellcheck.net/
I'am out as well.
Last edited by brontosaurusrex (2020-11-24 10:52:09)
Offline