ylmathfan铂金一
7 天前 发布在闲聊专区
【谈天说地】 test
check_if_running_as_root() {  # If you want to run as another user, please modify $UID to be owned by this user  if [[ "$UID" -ne '0' ]]; then    echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error."    read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root    if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then      echo "Continuing the installation with current user..."    else      echo "Not running with root, exiting..."      exit 1    fi  fi}
26
3
精彩评论3
ylmathfan铂金一
发表于 7 天前 显示全部楼层
check_if_running_as_root() {
  # If you want to run as another user, please modify $UID to be owned by this user
  if [[ "$UID" -ne '0' ]]; then
    echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error."
    read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root
    if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then
      echo "Continuing the installation with current user..."
    else
      echo "Not running with root, exiting..."
      exit 1
    fi
  fi
}
回复

使用道具 2#

ylmathfan铂金一 回复ylmathfan铂金一
发表于 2025-04-12 00:11:43
check_if_running_as_root() { # If you want to run as another user, please modify $UID to be owned by this user if [[ "$UID" -ne '0' ]]; then echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error." read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then echo "Continuing the installation with current user..." else echo "Not running with root, exiting..." exit 1 fi fi }
回复

ylmathfan铂金一 回复ylmathfan铂金一
发表于 2025-04-12 00:11:51
check_if_running_as_root() { # If you want to run as another user, please modify $UID to be owned by this user if [[ "$UID" -ne '0' ]]; then echo "WARNING: The user currently executing this script is not root. You may encounter the insufficient privilege error." read -r -p "Are you sure you want to continue? [y/n] " cont_without_been_root if [[ x"${cont_without_been_root:0:1}" = x'y' ]]; then echo "Continuing the installation with current user..." else echo "Not running with root, exiting..." exit 1 fi fi }
回复

高级模式
您需要登录后才可以回帖 登录 | 免费注册

  • 官方微信

    欢迎关注永洪服务号!收费为0,价值无限

    扫码关注
  • 新浪微博

    让每位用户轻松挖掘数据价值!

    访问新浪微博
  • 智能客服
100W

用户等你来哦

Copyright   ©2012-2025  北京永洪商智科技有限公司  (京ICP备12050607) 京公网安备110110802011451号 |《永洪社区协议》
返回顶部