root_need() {
if [[ $EUID -ne 0 ]]; then
echo "Error:This script must be run as root!" 1>&2
exit 1
fi
}
shell判断是否有root权限
最新推荐文章于 2024-05-07 11:54:50 发布
root_need() {
if [[ $EUID -ne 0 ]]; then
echo "Error:This script must be run as root!" 1>&2
exit 1
fi
}