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

prakash
Beiträge: 16
Registriert: 14 Sep 2023, 07:02

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

Beitrag von prakash »

New to opsi, I want to run a .sh script on target Ubuntu. Hope I can accomplish this with "opsi-script".
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1534
Registriert: 10 Jun 2015, 12:19

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

Beitrag von m.radtke »

Hi,

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

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

Regards
Mathias
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
prakash
Beiträge: 16
Registriert: 14 Sep 2023, 07:02

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

Beitrag 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
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1534
Registriert: 10 Jun 2015, 12:19

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

Beitrag 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
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
prakash
Beiträge: 16
Registriert: 14 Sep 2023, 07:02

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

Beitrag 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
Dateianhänge
script.PNG
script.PNG (105.87 KiB) 6019 mal betrachtet
log.PNG
log.PNG (88.72 KiB) 6019 mal betrachtet
prakash
Beiträge: 16
Registriert: 14 Sep 2023, 07:02

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

Beitrag von prakash »

Do I have to create a fresh thread?

Regards
arul
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1534
Registriert: 10 Jun 2015, 12:19

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

Beitrag 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
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
prakash
Beiträge: 16
Registriert: 14 Sep 2023, 07:02

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

Beitrag 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
Benutzeravatar
m.radtke
uib-Team
Beiträge: 1534
Registriert: 10 Jun 2015, 12:19

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

Beitrag 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
Kein Support per DM!
_________________________
opsi support - http://www.uib.de/
For productive opsi installations we recommend support contracts.
prakash
Beiträge: 16
Registriert: 14 Sep 2023, 07:02

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

Beitrag von prakash »

Could you please tell, how is that done.

Regards,
arul
Antworten