add
This commit is contained in:
@@ -11,6 +11,10 @@ cur_dir=$(pwd)
|
|||||||
# 检查root权限
|
# 检查root权限
|
||||||
[[ $EUID -ne 0 ]] && echo -e "${red}致命错误: ${plain} 请使用root权限运行此脚本 \n " && exit 1
|
[[ $EUID -ne 0 ]] && echo -e "${red}致命错误: ${plain} 请使用root权限运行此脚本 \n " && exit 1
|
||||||
|
|
||||||
|
if ! ip addr show lo | grep -q '127.0.0.1'; then
|
||||||
|
sudo ip addr add 127.0.0.1/8 dev lo
|
||||||
|
fi
|
||||||
|
|
||||||
# 检查操作系统并设置发行版变量
|
# 检查操作系统并设置发行版变量
|
||||||
if [[ -f /etc/os-release ]]; then
|
if [[ -f /etc/os-release ]]; then
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ cur_dir=$(pwd)
|
|||||||
# check root
|
# check root
|
||||||
[[ $EUID -ne 0 ]] && echo -e "${red}致命错误: ${plain} 请使用root权限运行此脚本 \n " && exit 1
|
[[ $EUID -ne 0 ]] && echo -e "${red}致命错误: ${plain} 请使用root权限运行此脚本 \n " && exit 1
|
||||||
|
|
||||||
|
if ! ip addr show lo | grep -q '127.0.0.1'; then
|
||||||
|
sudo ip addr add 127.0.0.1/8 dev lo
|
||||||
|
fi
|
||||||
|
|
||||||
# Check OS and set release variable
|
# Check OS and set release variable
|
||||||
if [[ -f /etc/os-release ]]; then
|
if [[ -f /etc/os-release ]]; then
|
||||||
source /etc/os-release
|
source /etc/os-release
|
||||||
|
|||||||
Reference in New Issue
Block a user