Seite 1 von 3

how to create a product that execute a given bash script for linux.

Verfasst: 14 Sep 2023, 07:12
von prakash
New to opsi, I want to run a .sh script on target Ubuntu. Hope I can accomplish this with "opsi-script".

Re: how to create a product that execute a given bash script for linux.

Verfasst: 14 Sep 2023, 10:42
von m.radtke
Hi,

you could use "shellCall()" to run your script

https://download.uib.de/opsi_stable/doc ... llCall_str

Regards
Mathias

Re: how to create a product that execute a given bash script for linux.

Verfasst: 14 Sep 2023, 12:37
von prakash
Thanks for your reply,
Being a novice, will be happy to know how to use that funtion. The complete cycle. any forum link or example will be helpful. This is going to be my first experience.

Regards
prakash

Re: how to create a product that execute a given bash script for linux.

Verfasst: 15 Sep 2023, 10:36
von m.radtke
Hi

you can install some of the linux localboot packages we provide and take a look into the setup.opsiscript and see how it is used there.

Regards
Mathias

Re: how to create a product that execute a given bash script for linux.

Verfasst: 27 Sep 2023, 14:43
von prakash
m.radtke hat geschrieben: 14 Sep 2023, 10:42 Hi,

you could use "shellCall()" to run your script

https://download.uib.de/opsi_stable/doc ... llCall_str

Regards
Mathias

Thanks for the hints, tried a shell script to touch a file in /tmp directory with "shellCall()", did not get the result. Attached is the script and log image of opsiclientd.log. Where is the mistake?

Regards
arul

Re: how to create a product that execute a given bash script for linux.

Verfasst: 28 Sep 2023, 12:26
von prakash
Do I have to create a fresh thread?

Regards
arul

Re: how to create a product that execute a given bash script for linux.

Verfasst: 28 Sep 2023, 14:02
von m.radtke
Hi

take a look into the opsi-script.log on the client in /var/log/opsi-script/
The shellcall is logged there and you can take a look if any errors occoured.

Regards
Mathias

Re: how to create a product that execute a given bash script for linux.

Verfasst: 28 Sep 2023, 14:37
von prakash
Hi Radtke

Thanks for your reply.
There is no error logged on opsi-script.log. Attached is a screenshot of the log on the previous post reply.

Regards,
arul

Re: how to create a product that execute a given bash script for linux.

Verfasst: 28 Sep 2023, 15:20
von m.radtke
Hi

you can also download the package locally and start opsi-script locally to see where the script breaks. Exit Code is 1 so there's something wrong.

Regards
Mathias

Re: how to create a product that execute a given bash script for linux.

Verfasst: 29 Sep 2023, 11:56
von prakash
Could you please tell, how is that done.

Regards,
arul