if [ "$(id -u)" != "0" ]; then echo "This script must be run as root" 1>&2 exit 1fi#该片段来自于http://www.codesnippet.cn/detail/060520133142.html
来源: http://www.codesnippet.cn/detail/060520133142.html