SOTI MobiControl Linux Shell Commands as a Package

Solved Locked
SM
Sascha Möller
REWE Systems GmbH

Hello

we are trying to manage Linux devices with SOTI MobiControl.

We are able to send shell-commands to the device with Send Scripts. Is it also possible to deploy shell-commands as a package (not only the supported linux script-commands)?

Thanks in Advance.

6 years ago
Linux
ANSWERS
DS
Durgesh, Singh
6 years ago (edited 6 years ago)

Hi Sascha,

With Send script or post package install script. You can use normal shell command to execute .sh file. 

If it is a normal sh, please use the sh command. Ex.       sh /tmp/USBScript.sh

in case it is Bash shell  you can use bash , Ex.   bash /home/sample/f4.sh

Instead of writing the scripts in shell file, you can write the shell scripts with all logic in Send script or pre/post install script panel with package and File Sync.

Solution
MD
Matt Dermody Diamond Contributor
6 years ago

I have very limited experience managing linux devices in MobiControl, but borrowing from experience with Android I know you can bundle scripts as pre-install or post-install scripts in otherwise empty packages. Perhaps that would work for your purposes as well?

SM
Sascha Möller
6 years ago
JD
John Doe
6 years ago

Copy your Shell Script and then open or execute the file with:

SM
Sascha Möller
6 years ago

Hi John,

are you able to execute shell-commands with this script-command in a package?

I tried this script-command (PostInstall: shell test.sh), but it doesnt work for us.

We get the following error: sh: 1: ./sendScript.sh: Exec format error

JD
John Doe
6 years ago

https://www.cyberciti.biz/faq/run-execute-sh-shell-script/

JD
John Doe
6 years ago (edited 6 years ago)

Check if you can run your script manualy from the device.

Have you made the script executable with chmod before?

SM
Sascha Möller
6 years ago (edited 6 years ago)

Hi John,

yes, i can run the shell-script manually and can send a script (shell bash /home/test.sh) with soti to run the shell-script, but it doenst work with a package...:(

JD
John Doe
6 years ago

Thats nice to now, thanks for sharing.

I thought you could only leverage the commands mentioned in the documentation and for more we´d use script files that were run through preinstall.

SM
Sascha Möller
6 years ago (edited 6 years ago)
DS
Durgesh, Singh
6 years ago

While creating package , please select ALL in platform for creating package for Linux platform. Could you share the script or sample script which you are trying to run as pre or post install script with package.

SM
Sascha Möller
5 years ago

Hello Durgesh,

i created the packages with two different versions of mobicontrol:

Package Studio 14.4.2 Build 308
Platform ALL
Processor ALL

Package Studio 14.2.0 Build 351
Platform Linux
Processor ALL

We use this sample-script for testing: reset /s

Regards, Sascha

DS
Durgesh, Singh
5 years ago (edited 5 years ago)

I have tried to run reset /s on raspberry pi (Raspbian 9 OS), it is giving me unknown terminal type of error.

Could you try to build package with simple shell scripts such as mkdir /home/SOTIinstallscriptTest/

Once you are successful, you can try to build complex shell scripts and run it via package.

SM
Sascha Möller
5 years ago (edited 5 years ago)

Hi Durgesh,

we are using Debian GNU/Linux 9.


Package Studio 14.4.2 Build 308
Platform ALL
Processor ALL

Test 1: PreInstall-Script (mkdir /home/SOTIinstallscriptTest/)

Error: Profile "Package" version 1 failed to install, because all of its payloads cannot be installed. Error: Package "Test" version 1.0 failed to install. Package file not found  

Test 2: PostInstall-Script (mkdir /home/SOTIinstallscriptTest/)

Profile is installed, but the script was not executed (directory was not created).

Package Studio 14.2.0 Build 351
Platform Linux
Processor ALL

Test 1: PreInstall-Script (mkdir /home/SOTIinstallscriptTest/)

Error: Profile "Package" version 3 failed to install, because all of its payloads cannot be installed. Error: Package "Test" version 3.0 failed to install. Package file not found  

Test 2: PostInstall-Script (mkdir /home/SOTIinstallscriptTest/)

Profile is installed, but the script was not executed (directory was not created).


Regards,

Sascha

SB
Sven Bielinski
5 years ago

Hi Durgesh, Could you please assist on this.

Thank you,

DS
Durgesh, Singh
5 years ago

Hi Shasha,

Could you tell me the processor name as well.

SM
Sascha Möller
5 years ago

Hi Durgesh,

we are using DLOG DLT-V7210 R:

  • Linux X86 (32 Bit)
  • Intel Atom E3845 Quad Core 1.91 GHz 4GB RAM

Regards,

Sascha

J
JVMOD@SOTI
5 years ago

Hello Sascha,

Following up on this thread, were you able to resolve the issue? If yes, I would like to know what were the steps taken to resolve the issue and I can mark that as a Solution.


Regards,

SM
Sascha Möller
5 years ago

Hello support team,

to execute shell commands it is necessary to start the scripts with #!/bin/sh. This info from durgesh solved our issue.

Regards,
Sascha

Similar Discussions