Q:

Get from string to variable in bash

I'm writing a bash script to automate some sysadmin stuff.  I start with checking that a number of variables are the defined.  The way I'm doing that now is like so:
function is_defined {
    if [ -z "$2" ]; then
        echo "$1 is not defined"
        exit
    fi
}

is_defined "PROJECTNAME" $PROJECTNAME

What I would love to have is a function that only takes one argument: the variable name as a string, checks that it is defined and if it's not defined tell the user so and exit. 
What's the right substitution magic to do this in bash? 

A:

Something like this:
function is_defined {
    if [ -z "${! 1}" ]; then
        echo "$1 is not defined"
        exit 1
    fi
}

${! a} as @sehe already stated will print value of variable, which name is $1

