mirror of
https://github.com/thelittlerocket/pve.git
synced 2024-11-15 19:44:38 +08:00
Update build_backend.sh
This commit is contained in:
parent
61448ad921
commit
d90241326a
1 changed files with 22 additions and 17 deletions
|
@ -8,26 +8,31 @@ _yellow() { echo -e "\033[33m\033[01m$@\033[0m"; }
|
||||||
_blue() { echo -e "\033[36m\033[01m$@\033[0m"; }
|
_blue() { echo -e "\033[36m\033[01m$@\033[0m"; }
|
||||||
|
|
||||||
# 创建资源池
|
# 创建资源池
|
||||||
_green "正在创建资源池 mypool..."
|
POOL_ID="mypool"
|
||||||
pvesh create /pools --poolid mypool
|
if pvesh get /pools/$POOL_ID > /dev/null 2>&1 ; then
|
||||||
_green "资源池 mypool 已创建!"
|
echo "资源池 $POOL_ID 已经存在!"
|
||||||
|
|
||||||
# 安装必备模块
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y sudo
|
|
||||||
apt-get install -y ifupdown2
|
|
||||||
apt-get install -y lshw
|
|
||||||
apt-get install -y iproute2
|
|
||||||
apt-get install -y net-tools
|
|
||||||
apt-get install -y cloud-init
|
|
||||||
if ! dpkg -s novnc > /dev/null 2>&1 ; then
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y novnc
|
|
||||||
echo "noVNC已成功安装"
|
|
||||||
else
|
else
|
||||||
echo "noVNC已安装"
|
# 如果不存在则创建
|
||||||
|
_green "正在创建资源池 $POOL_ID..."
|
||||||
|
pvesh create /pools --poolid $POOL_ID
|
||||||
|
_green "资源池 $POOL_ID 已创建!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 安装必备模块
|
||||||
|
install_required_modules() {
|
||||||
|
modules=("sudo" "ifupdown2" "lshw" "iproute2" "net-tools" "cloud-init" "novnc")
|
||||||
|
for module in "${modules[@]}"
|
||||||
|
do
|
||||||
|
if dpkg -s $module > /dev/null 2>&1 ; then
|
||||||
|
echo "$module 已经安装!"
|
||||||
|
else
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y $module
|
||||||
|
echo "$module 已成功安装!"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
install_required_modules
|
||||||
|
|
||||||
# 检测AppArmor模块
|
# 检测AppArmor模块
|
||||||
if ! dpkg -s apparmor > /dev/null 2>&1; then
|
if ! dpkg -s apparmor > /dev/null 2>&1; then
|
||||||
|
|
Loading…
Reference in a new issue