Test for root in a portable fashion.

  Rather than using this:

        if [ "$UID" = 0 ]; then

  We now use the more portable construct:

        if [ "$(id -ru)" = 0 ]; then

  Thanks to `checkbashisms` for the fix.