- 10 Oct 2024
- 5 読む分
- 印刷する
- PDF
Deploy Linux Shell scripts using Scalefusion
- 更新日 10 Oct 2024
- 5 読む分
- 印刷する
- PDF
Shell scripts are a powerful tool for automating tasks and simplifying configuration and can be used to automate almost any task in the Windows ecosystem. With a carefully designed script, you can automate various administrative tasks like adding users, installing applications, checking for OS updates to name a few. It becomes imperative for an MDM solution to provide support to be able to push scripts and then view detailed output.
Scalefusion offers you a powerful interface that lets you push scripts to all your devices and view detailed output on each of them. Follow the steps below to deploy a script and view the output.
Prerequisites
Enroll a Linux Device.
Scalefusion Enterprise Plan.
Step 1: Upload and Deploy the script
Navigate to Application Management > Enterprise Store , click on Upload New App and select Upload Linux Script
Using the script upload wizard upload your script and click Save
Script Name: Provide a name for your reference
Upload Script File: Click on the upload arrow and upload the script file from your local machine.
Once the script is saved you will be provide an option to publish the script. Select the profiles where you want to publish it and click Publish.
Once a script is published a push is sent to the devices and on all devices which are online the execution will start.
Once a script is published to the profile, all new devices enrolled here after will automatically execute this script post enrollment.
Step 2: View Status & Unpublish
All the uploaded scripts appear in the Enterprise store section. Clicking on Publish allows you to view details of the script.
Publish: Use this option to publish the script to device profiles.
Unpublish: Use this option to unpublish the script from device profiles.
Please note that this option would not undo the changes that the script did. Un-publishing would cause the script not be executed on the newly enrolled devices.
Summary: The summary pane gives you the information and current execution status,
Size: Indicates the size of script
Uploaded On: The time when this script was uploaded.
Installed On: Number of devices where it is executed.
Published To: Number of devices where it is published to.
The Installed On and Published To stats are retained even after a script is unpublished.
Preview: Use this option to preview the script that you uploaded.
View Status: Use this option to get detailed status of the script execution on each device and the output.
Click on View Detailsto check the output of the script execution.
Stdout: This tab gives you the output of the script.
Stderr: This tab gives you the error if any from the script execution.
Frequently Asked Questions
Question: How often the script is executed?
For now the script is only executed once the device receives it. We are looking at adding support for scheduling.
Question: Why does not the script execute again even when we Unpublish and Publishit again on the same profile?
Our current implementation requires you to delete the script completely and upload it again on the same profile if you want to execute it again.
Helper Scripts
We have curated some helper scripts, that lets you perform some administrative tasks readily. Please click on the links below to download the scripts and before using them, please replace the placeholders in them.
Please ensure that you use a UTF-8 editor like gedit on Ubuntu or notepad++ on Windows or Sublime Text so as to ensure that the generated script file is UTF-8 encoded.
Click on the Script link in the Script column which opens the script in a new browser window.
Copy the contents to a UTF-8 editor like notepad++ OR Sublime Text in Windows or geditin Ubuntu
If you are using notepad++ then use the bottom right panel to change the type to Unix (LF)
Update the script and replace the placeholders as required.
Upload the script to Scalefusion Dashboard and deploy it to the devices.
Scripts | Description |
---|---|
Use this script to allow input devices when you choose to block the USB devices via the device profile. | |
Use this script to create a local user with standard privileges. | |
Use this script to create a local user with Sudo/root privileges. | |
Use this script to change the password for a local user. | |
Use this script to retrieve the list of users on each device. | |
Use this script to install Google Chrome. | |
Use this script to install flatpack and install any applications. | |
Use this script to list available OS and app updates. | |
Use this script to install all available updates silently. | |
Use this script to block the websites defined in the script. | |
Use this script to unblock the websites defined in the script, that may have been blocked earlier. | |
Use this script to remotely lock the currently active user session on a Linux system. | |
Use this script to remotely update the Host names. | |
Use this script to remotely delete files and/or folders. | |
Use this script to give temporary Sudo access for specific user. | |
Use this script to block multiple apps from launching. | |
Use this script to allow selected applications. | |
Use this script to enable Bluetooth. | |
Use this script to disable Bluetooth. | |
Use this script to lock a user account. | |
Use this script to unlock a user account. | |
Use this script to delete a user account. | |
Use this script to check system service of the device(s). | |
Use this script to start the System services. | |
Use this script to download an image from a Google Drive and automatically set it as desktop wallpaper. | |
Use this script to lock the following folders: Documents, Downloads, Music, Pictures, Videos, snap, Public, Templates for both Standard and Sudo Users. | |
Use this script to unlock the following folders: Documents, Downloads, Music, Pictures, Videos, snap, Public, Templates for both Standard and Sudo Users. |
Notes:
1. Some of the scripts and their contents are sourced from internet and yes, our new friend ChatGPT.
2. Please validate the scripts on a test machine before deploying them on all your managed devices.
3. Scalefusion has tested these scripts, however Scalefusion will not be responsible for any loss of data or system malfunction that may arise due to the usage of these scripts.