Hi,

yes, it's possible in Karaf, but it's not actually really gogo shell.

Karaf uses its own shell with some additional features compared to gogo.

Regards
JB

On 27/05/2019 21:47, Eduardo wrote:
I use Karaf, and there it is posible by the use of the following command:

karaf@root()> shell:source /<your path>/my_update_script.sh

(On windows maybe you have to use \ instead of / and your script would
be .bat)


Inside my_update_script.sh, you can put the following lines (I usually
update my bundles from maven):


#!/bin/sh

echo "Uninstalling bundles"
bundle:uninstall bpe.mybundle1
bundle:uninstall bpe.mybundle2

echo "Updating with fresh bundles"
bundle:install mvn:bpe.mypackage/bpe.mybundle1/1.0.0-SNAPSHOT
bundle:install mvn:bpe.mypackage/bpe.mybundle2/1.0.0-SNAPSHOT

echo "Restarting bundles"
bundle:start bpe.mybundle1
bundle:start bpe.mybundle2


Before doing it, make sure you update and install .jars to maven
repository.  It may be needed to config your container as well, so it
can look at your local repo, if you have your bundles there.

And this is it.  I hope this answer your question.

Regards,



Eduardo García


On 5/10/19 2:56 AM, Alexandru Repede wrote:
i was wondering... maybe silly idea but why not : could i use the gogo
shell to make an installer/refresher for my bundles (given that i have a
fixed set of bundles)?

can the gogo shell read user input? i know i can output with "echo", but
the standard linux shell "read" is not supported

On Fri, 10 May 2019 at 09:39, Alexandru Repede <
alexandru.repede.stad...@gmail.com> wrote:

passed as env var at runtime : java -D"gosh.home"="conf/gogo" -jar
bin\felix.jar
where under felix-framework-6.0.2/conf, i made gogo/etc/gosh_profile

all good.
thx

On Fri, 10 May 2019 at 00:41, Raymond Auge <raymond.a...@liferay.com>
wrote:

a) gogo has a `source` command that will read a "gogo shell script" file.

b) with the system of framework property:

gosh.home=/foo

You can specify a directory which contains the following structure `
etc/gosh_profile`
where `gosh_profile` is a text file holding a gogo shell script.

Here's the canned script [1].
Here's the code that does the work [2]

HTH
- Ray

[1]

https://github.com/apache/felix/blob/trunk/gogo/shell/src/main/resources/gosh_profile
[2]

https://github.com/apache/felix/blob/trunk/gogo/shell/src/main/java/org/apache/felix/gogo/shell/Shell.java#L116-L129



On Thu, May 9, 2019 at 12:16 PM Alexandru Repede <
alexandru.repede.stad...@gmail.com> wrote:

As the GoGo shell support variables, functions, commands, can it also be
configured to load on startup a set of these from a file?



--
*Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile>
  (@rotty3000)
Senior Software Architect *Liferay, Inc.* <http://www.liferay.com>
  (@Liferay)
Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org>
(@OSGiAlliance)





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to