How do I get the server's label name from within the server?
✓ Best Answer
There's a Linode API call to do this:
What you're looking for is the "label"
P.S. If you put the Linode ID from the cloud manager into a file on your Linode (say /etc/linodeid), your query can read that file and just query that Linode…instead of having to sort through all the Linodes assigned to you (which is what the above returns to you). The Linode ID is a constant for the life of the Linode.
Ah so the label is not put anywhere don't the server, it has to be queried through the API.
The label is a construct of the Linode platform…not the VPS or the distro. You only have access to it using the facilities of the Linode platform (the API).
StackScripts do set a few environment variables, including LINODE_ID - but not label. But LINODE_ID may help you…