Scripts
Overview
The Scripts page lets you save frequently used bash commands so you can run them again on your servers and sites whenever you need, and browse scripts shared by other users.
Open the Scripts page from the Scripts item in the left menu. The page has two tabs:
- My Scripts: the scripts you have created.
- Marketplace: scripts that other users have shared and that have been approved.
The search box in the top-right corner filters the list in the open tab.
Create a script
- Click Add Custom Script.
- Enter a memorable name in the Memo field.
- Enter the bash content in the editor.
- (Optional) Check Share your script to the marketplace to share the script on the Marketplace tab (see Share a script).
- Click Add Custom Script (or press Ctrl/⌘ + S) to save.
The new script appears in the My Scripts tab.
Manage your scripts
The My Scripts tab shows the Memo, Content (truncated), and Share columns. The Share column shows the sharing status:
-: not shared.- Question mark icon (Reviewing): waiting for administrator approval.
- Check mark icon (Shared): visible on the Marketplace tab.
Actions:
- View the full content: click a row to expand it and see the whole script.
- Edit: click the edit icon, change the content in the Edit Custom Script dialog, then click Edit Custom Script.
- Delete: click the delete icon and confirm in the Delete Custom Script dialog.
Share a script
When you check Share your script to the marketplace, the script is submitted for administrator review. Once approved, it appears on the Marketplace tab with your name and avatar.
- If a shared script's content is changed, it must be reviewed again.
- To stop sharing, edit the script, uncheck Share your script to the marketplace, and save.
WARNING
Do not put passwords, tokens, secret keys, or private information in a shared script, because every user can read its content.
Use scripts from the marketplace
The Marketplace tab shows the Memo, Author, and Content columns. An author with a check mark next to their avatar is a verified account.
- Click a row to see the whole script.
- Click Copy to copy the script content.
- Click Save to My Scripts to open the create dialog with the content pre-filled. Edit it if needed, then click Add Custom Script to save it as your own script. The author's original script is not changed.
WARNING
Always read another user's script carefully before running it on your servers.
Where scripts are used
Your saved scripts are available in the following places:
| Where | How | Runs as |
|---|---|---|
| Connect a new server | Select a script in the Install Custom Script field. The script runs once after the server and the selected applications are installed; progress appears in Events as Install Custom Script. | root |
| The site's Commands page | Click the Custom Scripts icon in the corner of the Execute command editor: Paste inserts the script into the editor, Run runs it immediately. Commands run in the site's root directory. | The site user |
| The server or site Terminal window | Once the terminal is connected, click the Custom Scripts icon, then click Run to send the script to the terminal. | root (server terminal) or the site user (site terminal) |
| Deploy Script on the Deployment page | Click the Custom Scripts icon, then click Paste to insert the script into the editor. | The site user |
| Creating a CronJob | Click the Custom Scripts icon, then click Paste (or Run) to insert the script into the command field. | The user you choose for the CronJob |
| Installing WordPress | Click the Custom Scripts icon in the Install Custom Script editor, then click Paste (or Run) to insert the script. The script runs after WordPress is installed; prefix WordPress CLI commands with $WPCLI. | The site user |
The Custom Scripts dialog has two tabs: My Scripts and Marketplace. Use the search box to filter, and click a row or the Copy button to copy the content. Depending on where you open it, the dialog shows the Paste button, the Run button, or both.
Notes & warnings
- Note: Scripts run non-interactively, so you cannot enter input or passwords while they run. Use auto-confirm options such as
-yfor commands that prompt. - Note: Use full paths in your scripts, for example
/home/flashpanel/example.com, so they work wherever they run. - Warning: A script that runs as
rootwhen connecting a new server has full control of the server. Review it carefully before using it. - Note: Old links to the scripts page in the account area automatically open the My Scripts tab.