更新了文件检测方式,新增更换系统语言
This commit is contained in:
parent
0288eed8fb
commit
2cec79d034
@ -19,7 +19,7 @@ if [[ -z ${web_path} ]];then
|
||||
fi
|
||||
read -p "是否备份到本地,默认 关闭 ,输入 y 开启:" local_pick
|
||||
read -p "是否备份到百度网盘,默认 开启 ,输入 n 关闭:" baidu_pick
|
||||
read -p "是否备份到阿里云盘 默认 开启 , 输入 n 关闭" aliyun_pick
|
||||
read -p "是否备份到阿里云盘 默认 开启 , 输入 n 关闭:" aliyun_pick
|
||||
|
||||
if [[ ! $local_pick =~ [Yy] && $baidu_pick =~ [Nn] && $aliyun_pick =~ [Nn] ]];then
|
||||
echo "没有可备份的选项"
|
||||
@ -39,7 +39,16 @@ if [[ $local_pick =~ Yy ]];then
|
||||
fi
|
||||
|
||||
if [[ ! $baidu_pick =~ [Nn] ]];then
|
||||
sudo apt-get install python3-venv -y
|
||||
if ! command -v python3 -m venv &> /dev/null ; then
|
||||
if [[ -f "/usr/bin/apt-get" ]];then
|
||||
sudo apt-get install python3-venv -y
|
||||
elif [[ -f "/usr/bin/apt" ]];then
|
||||
sudo apt-get install python3-venv -y
|
||||
else
|
||||
echo "无法自动安装 python3-venv 请手动安装"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
python3 -m venv "${path}/venv"
|
||||
source "${path}/venv/bin/activate"
|
||||
pip install bypy
|
||||
@ -54,11 +63,9 @@ fi
|
||||
if [[ ! $aliyun_pick =~ [Nn] ]];then
|
||||
if [[ ! -d "${path}/aliyunpan" ]];then
|
||||
wget -P "${path}" https://github.com/tickstep/aliyunpan/releases/download/v0.3.2/aliyunpan-v0.3.2-linux-amd64.zip -O "${path}/aliyunpan.zip"
|
||||
unzip aliyunpan.zip
|
||||
unzip "${path}/aliyunpan.zip" -d "${path}"
|
||||
rm "${path}/aliyunpan.zip"
|
||||
declare tmp_file=$( ls "${path}" | grep "aliyunpan" )
|
||||
mv "${path}/${tmp_file}" "${path}/aliyunpan"
|
||||
mv "${path}/$(ls "${path}" | grep "aliyunpan")" "${path}/aliyunpan"
|
||||
${path}/aliyunpan/aliyunpan login
|
||||
else
|
||||
echo "检测到阿里云盘已经存在,请确认是否登录"
|
||||
|
@ -1,4 +1,3 @@
|
||||
declare version=$(cat /etc/os-release | grep '^ID' | awk -F '=' '{print $2}')
|
||||
declare path=$1
|
||||
declare cron=$2
|
||||
|
||||
@ -6,20 +5,19 @@ if [[ -f "${path}/update.sh" ]];then
|
||||
echo "该路径文件已经存在"
|
||||
fi
|
||||
|
||||
case "$version" in
|
||||
'debian')
|
||||
cat > "${path}/update.sh" << EOF
|
||||
#!/bin/bash
|
||||
sudo apt update
|
||||
sudo apt-get update
|
||||
sudo apt dist-upgrade
|
||||
sudo apt-get dist-upgrade
|
||||
EOF
|
||||
;;
|
||||
*)
|
||||
echo "暂不支持该系统配置自动更新软件"
|
||||
exit
|
||||
esac
|
||||
echo '#!/bin/bash' > "${path}/update.sh"
|
||||
|
||||
if [[ -f "/usr/bin/apt" ]];then
|
||||
echo 'sudo apt update' >> "${path}/update.sh"
|
||||
echo 'sudo apt-get dist-upgrade' >> "${path}/update.sh"
|
||||
elif [[ -f "/usr/bin/apt-get" ]];then
|
||||
echo 'sudo apt-get update' >> "${path}/update.sh"
|
||||
echo 'sudo apt dist-upgrade' >> "${path}/update.sh"
|
||||
else
|
||||
rm "${path}/update.sh"
|
||||
echo "暂不支持该系统配置自动更新软件"
|
||||
exit
|
||||
fi
|
||||
|
||||
chmod +x "${path}/update.sh"
|
||||
|
||||
|
256
Menus/Login.sh
256
Menus/Login.sh
@ -13,170 +13,170 @@ read -p "请输入要使用的功能:" pick
|
||||
|
||||
case $pick in
|
||||
1)
|
||||
declare password
|
||||
declare password
|
||||
read -p "请输入root密码:" password
|
||||
echo "root:$password" |sudo chpasswd
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
||||
sudo systemctl restart sshd.service
|
||||
echo "root:$password" |sudo chpasswd
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
||||
sudo systemctl restart sshd.service
|
||||
echo "修改成功当前root密码为:$password"
|
||||
;;
|
||||
;;
|
||||
2)
|
||||
declare key
|
||||
echo "请输入公钥或文件路径:"
|
||||
echo "默认:$HOME/.ssh/id_rsa.pub"
|
||||
read -p "回车默认:" key
|
||||
declare key
|
||||
echo "请输入公钥或文件路径:"
|
||||
echo "默认:$HOME/.ssh/id_rsa.pub"
|
||||
read -p "回车默认:" key
|
||||
|
||||
if [[ -z $key ]];then
|
||||
key="$HOME/.ssh/id_rsa.pub"
|
||||
fi
|
||||
if [[ -z $key ]];then
|
||||
key="$HOME/.ssh/id_rsa.pub"
|
||||
fi
|
||||
|
||||
if [[ -f $key ]];then
|
||||
key=$(cat "$key")
|
||||
fi
|
||||
if [[ ! $key =~ ^ssh-(rsa|ecdsa-sha2-nistp[0-9]+|ed25519|dss) ]];then
|
||||
echo "公钥不合法"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -f $key ]];then
|
||||
key=$(cat "$key")
|
||||
fi
|
||||
if [[ ! $key =~ ^ssh-(rsa|ecdsa-sha2-nistp[0-9]+|ed25519|dss) ]];then
|
||||
echo "公钥不合法"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/.ssh"
|
||||
echo "$key" > "$HOME/.ssh/authorized_keys"
|
||||
mkdir -p "$HOME/.ssh"
|
||||
echo "$key" > "$HOME/.ssh/authorized_keys"
|
||||
|
||||
chmod 600 "$HOME/.ssh/authorized_keys"
|
||||
chmod 700 "$HOME/.ssh"
|
||||
chmod 600 "$HOME/.ssh/authorized_keys"
|
||||
chmod 700 "$HOME/.ssh"
|
||||
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
|
||||
declare pick2
|
||||
echo "是否关闭密码登录:"
|
||||
read -p "输入 n 取消关闭:" pick2
|
||||
declare pick2
|
||||
echo "是否关闭密码登录:"
|
||||
read -p "输入 n 取消关闭:" pick2
|
||||
|
||||
if [[ ! $pick2 =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||
fi
|
||||
if [[ ! $pick2 =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||
fi
|
||||
|
||||
|
||||
sudo systemctl restart sshd.service
|
||||
sudo systemctl restart sshd.service
|
||||
|
||||
echo "密钥安装完成"
|
||||
;;
|
||||
echo "密钥安装完成"
|
||||
;;
|
||||
3)
|
||||
declare user_name
|
||||
read -p "请输入你想创建的用户名:" user_name
|
||||
declare user_name
|
||||
read -p "请输入你想创建的用户名:" user_name
|
||||
|
||||
if id "$user_name" &>/dev/null; then
|
||||
echo "用户 $user_name 已存在。"
|
||||
exit 1
|
||||
fi
|
||||
if id "$user_name" &>/dev/null; then
|
||||
echo "用户 $user_name 已存在。"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
useradd -m -s /bin/bash "$user_name"
|
||||
useradd -m -s /bin/bash "$user_name"
|
||||
|
||||
if grep -q "^$user_name " /etc/sudoers;then
|
||||
sudo sed -i "s/^#\?$user_name.*/lsy ALL=(ALL) NOPASSWD: ALL/g" /etc/sudoers
|
||||
else
|
||||
sudo echo "lsy ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
fi
|
||||
if grep -q "^$user_name " /etc/sudoers;then
|
||||
sudo sed -i "s/^#\?$user_name.*/lsy ALL=(ALL) NOPASSWD: ALL/g" /etc/sudoers
|
||||
else
|
||||
sudo echo "lsy ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
fi
|
||||
|
||||
|
||||
declare pick
|
||||
echo "用户登录方式"
|
||||
echo "y.密码登录"
|
||||
echo "n.使用root用户公钥"
|
||||
read -p "默认y,请输入:" pick
|
||||
if [[ ! $pick =~ [Nn] ]];then
|
||||
declare password
|
||||
read -p "请输入密码:" password
|
||||
echo "$user_name:$password" |sudo chpasswd
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
|
||||
echo "创建成功"
|
||||
echo "账号:$user_name"
|
||||
echo "密码:$password"
|
||||
else
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
su "$user_name" -c "mkdir -p '/home/$user_name/.ssh'"
|
||||
sudo cp "/root/.ssh/authorized_keys" "/home/$user_name/.ssh/authorized_keys"
|
||||
sudo chown lsy:lsy "/home/$user_name/.ssh/authorized_keys"
|
||||
su "$user_name" -c "chmod 600 '/home/$user_name/.ssh/authorized_keys'"
|
||||
su "$user_name" -c "chmod 700 '/home/$user_name/.ssh/'"
|
||||
declare pick
|
||||
echo "用户登录方式"
|
||||
echo "y.密码登录"
|
||||
echo "n.使用root用户公钥"
|
||||
read -p "默认y,请输入:" pick
|
||||
if [[ ! $pick =~ [Nn] ]];then
|
||||
declare password
|
||||
read -p "请输入密码:" password
|
||||
echo "$user_name:$password" |sudo chpasswd
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
|
||||
echo "创建成功"
|
||||
echo "账号:$user_name"
|
||||
echo "密码:$password"
|
||||
else
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
su "$user_name" -c "mkdir -p '/home/$user_name/.ssh'"
|
||||
sudo cp "/root/.ssh/authorized_keys" "/home/$user_name/.ssh/authorized_keys"
|
||||
sudo chown lsy:lsy "/home/$user_name/.ssh/authorized_keys"
|
||||
su "$user_name" -c "chmod 600 '/home/$user_name/.ssh/authorized_keys'"
|
||||
su "$user_name" -c "chmod 700 '/home/$user_name/.ssh/'"
|
||||
|
||||
echo "创建成功"
|
||||
echo "账号:$user_name"
|
||||
echo "密钥登录"
|
||||
fi
|
||||
echo "创建成功"
|
||||
echo "账号:$user_name"
|
||||
echo "密钥登录"
|
||||
fi
|
||||
|
||||
declare pick2
|
||||
echo "是否关闭root登录"
|
||||
read -p "输入 n 取消关闭:" pick2
|
||||
declare pick2
|
||||
echo "是否关闭root登录"
|
||||
read -p "输入 n 取消关闭:" pick2
|
||||
|
||||
if [[ ! $pick2 =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config
|
||||
echo "root用户登录已关闭"
|
||||
fi
|
||||
if [[ ! $pick2 =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config
|
||||
echo "root用户登录已关闭"
|
||||
fi
|
||||
|
||||
sudo systemctl restart sshd.service
|
||||
sudo systemctl restart sshd.service
|
||||
|
||||
;;
|
||||
;;
|
||||
4)
|
||||
declare pick_root
|
||||
declare pick2_key
|
||||
declare pick2_password
|
||||
echo "是否关闭root登录"
|
||||
read -p "输入 n 关闭:" pick_root
|
||||
echo "是否关闭密码登录"
|
||||
read -p "输入 n 关闭:" pick2_password
|
||||
echo "是否关闭密钥登录"
|
||||
read -p "输入 n 关闭:" pick2_key
|
||||
declare pick_root
|
||||
declare pick2_key
|
||||
declare pick2_password
|
||||
echo "是否关闭root登录"
|
||||
read -p "输入 n 关闭:" pick_root
|
||||
echo "是否关闭密码登录"
|
||||
read -p "输入 n 关闭:" pick2_password
|
||||
echo "是否关闭密钥登录"
|
||||
read -p "输入 n 关闭:" pick2_key
|
||||
|
||||
if [[ ! $pick_root =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
||||
echo "root用户登录:开启"
|
||||
else
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config
|
||||
echo "root用户登录:关闭"
|
||||
fi
|
||||
if [[ ! $pick_root =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
|
||||
echo "root用户登录:开启"
|
||||
else
|
||||
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin no/g' /etc/ssh/sshd_config
|
||||
echo "root用户登录:关闭"
|
||||
fi
|
||||
|
||||
if [[ ! $pick2_password =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
||||
echo "密码登录:开启"
|
||||
else
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||
echo "密码登录:关闭"
|
||||
fi
|
||||
if [[ ! $pick2_password =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
|
||||
echo "密码登录:开启"
|
||||
else
|
||||
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication no/g' /etc/ssh/sshd_config
|
||||
echo "密码登录:关闭"
|
||||
fi
|
||||
|
||||
if [[ ! $pick2_key =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
echo "密钥登录:开启"
|
||||
else
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config
|
||||
echo "密钥登录:关闭"
|
||||
fi
|
||||
if [[ ! $pick2_key =~ [Nn] ]];then
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication yes/g' /etc/ssh/sshd_config
|
||||
echo "密钥登录:开启"
|
||||
else
|
||||
sudo sed -i 's/^#\?PubkeyAuthentication.*/PubkeyAuthentication no/g' /etc/ssh/sshd_config
|
||||
echo "密钥登录:关闭"
|
||||
fi
|
||||
|
||||
sudo systemctl restart sshd.service
|
||||
;;
|
||||
sudo systemctl restart sshd.service
|
||||
;;
|
||||
5)
|
||||
read -p "请输入需要修改的端口号(默认22): " port_number
|
||||
read -p "请输入需要修改的端口号(默认22): " port_number
|
||||
|
||||
if [[ -z $port_number ]];then
|
||||
port_number=22
|
||||
fi
|
||||
if [[ -z $port_number ]];then
|
||||
port_number=22
|
||||
fi
|
||||
|
||||
if ! [[ $port_number =~ ^[0-9]+$ ]] || ! ((port_number > 0 && port_number < 65535)); then
|
||||
echo "端口不合法"
|
||||
exit
|
||||
fi
|
||||
if ! [[ $port_number =~ ^[0-9]+$ ]] || ! ((port_number > 0 && port_number < 65535)); then
|
||||
echo "端口不合法"
|
||||
exit
|
||||
fi
|
||||
|
||||
if sudo lsof -i :$port_number -t >/dev/null; then
|
||||
echo "$port_number 端口已被占用"
|
||||
exit
|
||||
fi
|
||||
if sudo lsof -i :$port_number -t >/dev/null; then
|
||||
echo "$port_number 端口已被占用"
|
||||
exit
|
||||
fi
|
||||
|
||||
sudo sed -i "s/^#\?Port.*/Port $port_number/g" /etc/ssh/sshd_config
|
||||
sudo sed -i "s/^#\?Port.*/Port $port_number/g" /etc/ssh/sshd_config
|
||||
|
||||
sudo systemctl restart sshd.service
|
||||
sudo systemctl restart sshd.service
|
||||
|
||||
echo "端口已经修改为$port_number,记得防火墙放行"
|
||||
;;
|
||||
echo "端口已经修改为$port_number,记得防火墙放行"
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
clear
|
||||
esac
|
||||
|
||||
|
@ -1,19 +1,56 @@
|
||||
declare pick
|
||||
echo "========Other========"
|
||||
echo "1.开启BBR"
|
||||
echo "2.更换系统语言"
|
||||
echo "输入其他任意返回主页"
|
||||
echo "========Other========"
|
||||
read -p "请输入:" pick
|
||||
|
||||
case "$pick" in
|
||||
'1')
|
||||
declare version=$(uname -r | awk -F "." '{print $1}')
|
||||
if ! [[ $version -ge 5 ]];then
|
||||
echo "系统内核版本过低"
|
||||
exit
|
||||
fi
|
||||
grep -q "net.core.default_qdisc=fq" "/etc/sysctl.conf" || echo 'net.core.default_qdisc=fq' | sudo tee -a "/etc/sysctl.conf"
|
||||
grep -q "net.ipv4.tcp_congestion_control=bbr" "/etc/sysctl.conf" || echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a "/etc/sysctl.conf"
|
||||
sudo sysctl -p || echo "bbr 开启失败"
|
||||
sysctl net.ipv4.tcp_available_congestion_control | grep bbr && echo "bbr 开启成功"
|
||||
declare version=$(uname -r | awk -F "." '{print $1}')
|
||||
if ! [[ $version -ge 5 ]];then
|
||||
echo "系统内核版本过低"
|
||||
exit
|
||||
fi
|
||||
grep -q "net.core.default_qdisc=fq" "/etc/sysctl.conf" || echo 'net.core.default_qdisc=fq' | sudo tee -a "/etc/sysctl.conf"
|
||||
grep -q "net.ipv4.tcp_congestion_control=bbr" "/etc/sysctl.conf" || echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a "/etc/sysctl.conf"
|
||||
sudo sysctl -p || echo "bbr 开启失败"
|
||||
sysctl net.ipv4.tcp_available_congestion_control | grep bbr && echo "bbr 开启成功"
|
||||
;;
|
||||
'2')
|
||||
declare lang
|
||||
echo "1.中文"
|
||||
echo "2.英文"
|
||||
read -p "请输入:" lang
|
||||
if [[ -f "/usr/bin/apt-get" ]];then
|
||||
sudo apt-get install -y locales
|
||||
sudo apt-get install -y language-pack-zh-hans
|
||||
elif [[ -f "/usr/bin/apt" ]];then
|
||||
sudo apt install -y locales
|
||||
sudo apt install -y language-pack-zh-hans
|
||||
else
|
||||
echo "暂不支持该系统一键更换语言"
|
||||
exit
|
||||
fi
|
||||
case $lang in
|
||||
'1')
|
||||
sudo sed -i 's/.*zh_CN.UTF-8.*/zh_CN.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sudo sed -i "s/^LANG.*/LANG=zh_CN.UTF-8/g" /etc/default/locale
|
||||
sudo sed -i "s/^LC_ALL.*/LC_ALL=zh_CN.UTF-8/g" /etc/default/locale
|
||||
source /etc/default/locale
|
||||
sudo locale-gen
|
||||
update-locale
|
||||
echo "中文语言更换成功"
|
||||
;;
|
||||
'2')
|
||||
sudo sed -i 's/.*en_US.UTF-8.*/en_US.UTF-8 UTF-8/g' /etc/locale.gen
|
||||
sudo sed -i "s/^LANG.*/LANG=en_US.UTF-8/g" /etc/default/locale
|
||||
sudo sed -i "s/^LC_ALL.*/LC_ALL=en_US.UTF-8/g" /etc/default/locale
|
||||
source /etc/default/locale
|
||||
sudo locale-gen
|
||||
update-locale
|
||||
echo "英文语言更换成功"
|
||||
;;
|
||||
esac
|
||||
esac
|
@ -1,16 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
declare install_str
|
||||
declare version=$(cat /etc/os-release | grep -w 'ID' | awk -F '=' '{print $2}')
|
||||
case "$version" in
|
||||
'debian')
|
||||
install_str='apt-get install'
|
||||
|
||||
;;
|
||||
*)
|
||||
echo "暂不支持该系统一键安装常用软件"
|
||||
exit
|
||||
esac
|
||||
|
||||
declare pkg
|
||||
if [[ -f "/usr/bin/apt-get" ]];then
|
||||
pkg='apt-get'
|
||||
elif [[ -f "/usr/bin/apt" ]];then
|
||||
pkg='apt'
|
||||
else
|
||||
echo "暂不支持该系统一键安装常用软件"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
declare pick
|
||||
declare -a soft_array
|
||||
@ -62,7 +63,7 @@ if [[ ! $pick_docker =~ [Nn] ]];then
|
||||
read -p "请输入需要选择的镜像站:" docker_img_number_pick
|
||||
declare docker_img
|
||||
if [[ ! $docker_img_number_pick =~ [1-${#docker_imgs[@]}] ]];then
|
||||
docker_img='https://mirrors.ustc.edu.cn/docker-ce'
|
||||
docker_img='https://mirrors.sustc.edu.cn/docker-ce'
|
||||
else
|
||||
docker_img_number_pick=${docker_img_number[$docker_img_number_pick]}
|
||||
docker_img=${docker_imgs[$docker_img_number_pick]}
|
||||
@ -76,7 +77,7 @@ if [[ ! $pick_x =~ [Nn] ]];then
|
||||
fi
|
||||
|
||||
|
||||
eval "$install_str -y"
|
||||
eval "sudo ${pkg} install -y ${install_str}"
|
||||
if [[ ! $pick_x =~ [Nn] ]];then
|
||||
eval "$(curl https://get.x-cmd.com)"
|
||||
fi
|
||||
@ -93,9 +94,9 @@ fi
|
||||
|
||||
|
||||
if [[ ! $pick_docker =~ [Nn] ]];then
|
||||
if [[ $version == 'debian' ]];then
|
||||
sudo apt-get update
|
||||
sudo apt-get install ca-certificates curl -y
|
||||
if [[ ${pkg} == 'apt' || ${pkg} == 'apt-get' ]];then
|
||||
sudo ${pkg} update
|
||||
sudo ${pkg} install ca-certificates curl -y
|
||||
sudo install -m 0755 -d /etc/apt/keyrings
|
||||
sudo curl -fsSL "${docker_img}/linux/${version}/gpg" -o /etc/apt/keyrings/docker.asc
|
||||
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||
@ -103,8 +104,8 @@ if [[ ! $pick_docker =~ [Nn] ]];then
|
||||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] ${docker_img}/linux/${version} \
|
||||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||
sudo apt-get update
|
||||
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
sudo ${pkg} update
|
||||
sudo ${pkg} install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -48,6 +48,7 @@ deb ${url}/debian/ bookworm main contrib non-free non-free-firmware
|
||||
deb ${url}/debian/ bookworm-updates main contrib non-free non-free-firmware
|
||||
deb ${url}/debian/ bookworm-backports main contrib non-free non-free-firmware
|
||||
EOF
|
||||
sudo apt update
|
||||
sudo apt-get update
|
||||
;;
|
||||
*)
|
||||
|
Loading…
Reference in New Issue
Block a user