Overview
The “Scripts” page stores setup scripts that run on a Linux server the first time it boots after being built. Use them to install packages, create users, write config files, or run your own commands, so a new server comes up ready to use. A saved script does nothing on its own. It runs only when you pick it while ordering a new server or reinstalling an existing one. Open the Ascienth console at https://console.advinservers.com and click “Scripts” under “Setup” in the left sidebar. Scripts are saved in the team you are working in. Each team has its own list, so switch to the right team before you add one.Script Types
When a
Cloud-config document is combined with the image’s own settings:
- Lists of work, such as
packages,runcmd,bootcmd,write_files,usersandssh_authorized_keys, are added together. Your entries come after the image’s, and exact duplicates are skipped. - For any other setting that both define, your value wins.
Limits and Checks
Name: up to 64 characters, unique in your account.- Script content: up to 1 MiB.
- A
Cloud-configdocument must be valid YAML and must be a list of settings such aspackages:orruncmd:. Otherwise you see an error explaining the problem before the script is saved. - A
cloud-configdocument saved as aBash scriptis refused, because it would fail when run as a shell script. Choose theCloud-configtype for it instead.
Scripts often contain passwords or tokens. We store script content encrypted. Anyone in your team with the
View setup scripts permission can still read it.Adding a Script
1
Open the form
On the “Scripts” page, click
Add Script.2
Name it and pick a type
Enter a
Name and choose a Type: Cloud-config or Bash script. The editor starts with #cloud-config or #!/bin/bash for you.3
Write the script
Write or paste your script into the editor.
4
Save
Click
Create. The script can now be picked the next time you order or reinstall a server.Create Script. The new script is selected for you.
Running a Script on a Server
Saved scripts appear in the “Setup Script” section of two forms:- Ordering a server, on the “Order a Server” page.
- Reinstalling a server, on the server’s “Reinstall” tab. See Server Reinstallation.
Editing or Deleting a Script
Click the menu at the end of the script’s row:Editlets you change the name, type and content. ClickSavewhen you are done.Deleteremoves the script. To confirm, type the script’s name and clickDelete.
Move to team to move a script to another of their teams.
Team Permissions
The team owner can always manage scripts. Members need these permissions in their role:
See Team Members and Roles.
Frequently Asked Questions
My script did not seem to run. How do I check?
My script did not seem to run. How do I check?
Log in to the server and check its first-boot logs under
/var/log/. Our services are unmanaged, so we cannot debug the script for you.Can I run a script on a server that is already running?
Can I run a script on a server that is already running?
No. Scripts only run when a server is ordered or reinstalled. On a running server, run the commands yourself.
Using the API
You can manage scripts with an API key that has theView setup scripts, Manage setup scripts or Delete setup scripts permission for its team. In the API, scripts are called user-scripts, and type is cloud-config or bash.