软件安装包管理器更改,所有安装加y,改绝对路径,美化安装不完全
This commit is contained in:
parent
8c33d581a4
commit
79a3b35ce7
@ -8,11 +8,11 @@ fi
|
|||||||
echo '#!/bin/bash' > "${path}/update.sh"
|
echo '#!/bin/bash' > "${path}/update.sh"
|
||||||
|
|
||||||
if [[ -f "/usr/bin/apt" ]];then
|
if [[ -f "/usr/bin/apt" ]];then
|
||||||
echo 'sudo apt update' >> "${path}/update.sh"
|
echo 'sudo apt update -y' >> "${path}/update.sh"
|
||||||
echo 'sudo apt-get dist-upgrade' >> "${path}/update.sh"
|
echo 'sudo apt-get dist-upgrad -y' >> "${path}/update.sh"
|
||||||
elif [[ -f "/usr/bin/apt-get" ]];then
|
elif [[ -f "/usr/bin/apt-get" ]];then
|
||||||
echo 'sudo apt-get update' >> "${path}/update.sh"
|
echo 'sudo apt-get update -y' >> "${path}/update.sh"
|
||||||
echo 'sudo apt dist-upgrade' >> "${path}/update.sh"
|
echo 'sudo apt dist-upgrade -y' >> "${path}/update.sh"
|
||||||
else
|
else
|
||||||
rm "${path}/update.sh"
|
rm "${path}/update.sh"
|
||||||
echo "暂不支持该系统配置自动更新软件"
|
echo "暂不支持该系统配置自动更新软件"
|
||||||
|
@ -48,10 +48,10 @@ fi
|
|||||||
|
|
||||||
case $pick in
|
case $pick in
|
||||||
'1')
|
'1')
|
||||||
bash Config/Automation/backup.sh "$path" "$cron"
|
bash "${PWD}/Config/Automation/backup.sh" "$path" "$cron"
|
||||||
;;
|
;;
|
||||||
'2')
|
'2')
|
||||||
bash Config/Automation/update.sh "$path" "$cron"
|
bash "${PWD}/Config/Automation/update.sh" "$path" "$cron"
|
||||||
;;
|
;;
|
||||||
'3')
|
'3')
|
||||||
if ! command -v docker &> /dev/null; then
|
if ! command -v docker &> /dev/null; then
|
||||||
|
@ -91,7 +91,7 @@ elif [[ "${pick}" -gt "$((${pick_number}-${#pick_array[*]}))" && "${pick}" -le "
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bash Config/Docker/${pick_array[${pick}]}.sh "$file_path" "$port"
|
bash "${PWD}/Config/Docker/${pick_array[${pick}]}.sh" "$file_path" "$port"
|
||||||
echo "${pick_array[${pick}]}安装完成,访问端口${port}"
|
echo "${pick_array[${pick}]}安装完成,访问端口${port}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -24,13 +24,13 @@ case "$pick" in
|
|||||||
echo "2.英文"
|
echo "2.英文"
|
||||||
read -p "请输入:" lang
|
read -p "请输入:" lang
|
||||||
if [[ -f "/usr/bin/apt-get" ]];then
|
if [[ -f "/usr/bin/apt-get" ]];then
|
||||||
sudo apt-get update
|
sudo apt-get update -y
|
||||||
sudo apt-get dist-upgrade
|
sudo apt-get dist-upgrade -y
|
||||||
sudo apt-get install -y locales
|
sudo apt-get install -y locales
|
||||||
sudo apt-get install -y language-pack-zh-hans
|
sudo apt-get install -y language-pack-zh-hans
|
||||||
elif [[ -f "/usr/bin/apt" ]];then
|
elif [[ -f "/usr/bin/apt" ]];then
|
||||||
sudo apt update
|
sudo apt update -y
|
||||||
sudo apt dist-upgrade
|
sudo apt dist-upgrade -y
|
||||||
sudo apt install -y locales
|
sudo apt install -y locales
|
||||||
sudo apt install -y language-pack-zh-hans
|
sudo apt install -y language-pack-zh-hans
|
||||||
else
|
else
|
||||||
|
@ -5,13 +5,13 @@ declare version="$(cat /etc/os-release | grep "^ID" | awk -F '=' '{print $2}')"
|
|||||||
|
|
||||||
declare pkg
|
declare pkg
|
||||||
if [[ -f "/usr/bin/apt-get" ]];then
|
if [[ -f "/usr/bin/apt-get" ]];then
|
||||||
pkg='apt-get'
|
pkg='apt-get install -y'
|
||||||
sudo apt-get update
|
sudo apt-get update -y
|
||||||
sudo apt-get dist-upgrade
|
sudo apt-get dist-upgrade -y
|
||||||
elif [[ -f "/usr/bin/apt" ]];then
|
elif [[ -f "/usr/bin/apt" ]];then
|
||||||
pkg='apt'
|
pkg='apt install -y'
|
||||||
sudo apt update
|
sudo apt update -y
|
||||||
sudo apt dist-upgrade
|
sudo apt dist-upgrade -y
|
||||||
else
|
else
|
||||||
echo "暂不支持该系统一键安装常用软件"
|
echo "暂不支持该系统一键安装常用软件"
|
||||||
exit
|
exit
|
||||||
@ -81,13 +81,13 @@ if [[ ! $pick_x =~ [Nn] ]];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
eval "sudo ${pkg} install -y ${install_str}"
|
eval "sudo ${pkg} ${install_str}"
|
||||||
if [[ ! $pick_x =~ [Nn] ]];then
|
if [[ ! $pick_x =~ [Nn] ]];then
|
||||||
eval "$(curl https://get.x-cmd.com)"
|
eval "$(curl https://get.x-cmd.com)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! $pick_docker =~ [Nn] ]];then
|
if [[ ! $pick_docker =~ [Nn] ]];then
|
||||||
if [[ ${pkg} == 'apt' || ${pkg} == 'apt-get' ]];then
|
if [[ ${pkg} =~ '^apt' || ${pkg} =~ '^apt-get' ]];then
|
||||||
sudo ${pkg} update
|
sudo ${pkg} update
|
||||||
sudo ${pkg} install ca-certificates curl -y
|
sudo ${pkg} install ca-certificates curl -y
|
||||||
sudo install -m 0755 -d /etc/apt/keyrings
|
sudo install -m 0755 -d /etc/apt/keyrings
|
||||||
@ -104,13 +104,16 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
if [[ ! $pick_zsh =~ [Nn] ]];then
|
if [[ ! $pick_zsh =~ [Nn] ]];then
|
||||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh | sh
|
||||||
zsh
|
while [[ ! -d "$HOME/.oh-my-zsh" ]]; do
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
|
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
|
||||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
|
||||||
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
|
||||||
sudo sed -i 's/^#\?ZSH_THEME.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ~/.zshrc
|
sudo sed -i 's/^#\?ZSH_THEME.*/ZSH_THEME="powerlevel10k\/powerlevel10k"/g' ~/.zshrc
|
||||||
sudo sed -i 's/^#\?plugins.*/plugins=(zsh-syntax-highlighting zsh-autosuggestions command-not-found)/g' ~/.zshrc
|
sudo sed -i 's/^#\?plugins.*/plugins=(zsh-syntax-highlighting zsh-autosuggestions command-not-found)/g' ~/.zshrc
|
||||||
|
source ~/.zshrc
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ 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-updates main contrib non-free non-free-firmware
|
||||||
deb ${url}/debian/ bookworm-backports main contrib non-free non-free-firmware
|
deb ${url}/debian/ bookworm-backports main contrib non-free non-free-firmware
|
||||||
EOF
|
EOF
|
||||||
sudo apt update
|
sudo apt update -y
|
||||||
sudo apt-get update
|
sudo apt-get update -y
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "暂不支持该系统配置自动更新软件"
|
echo "暂不支持该系统配置自动更新软件"
|
||||||
|
4
Run.sh
4
Run.sh
@ -14,7 +14,7 @@ do
|
|||||||
|
|
||||||
pick_number=0
|
pick_number=0
|
||||||
echo "======Linux工具箱======"
|
echo "======Linux工具箱======"
|
||||||
cd Menus
|
cd Menus || exit
|
||||||
for i in *
|
for i in *
|
||||||
do
|
do
|
||||||
pick_number=$((pick_number + 1))
|
pick_number=$((pick_number + 1))
|
||||||
@ -26,7 +26,7 @@ echo "======Linux工具箱======"
|
|||||||
read -p "请输入要使用的功能:" pick
|
read -p "请输入要使用的功能:" pick
|
||||||
if [[ "${pick}" -gt 0 && "${pick}" -le "${#pick_array[*]}" ]];then
|
if [[ "${pick}" -gt 0 && "${pick}" -le "${#pick_array[*]}" ]];then
|
||||||
clear
|
clear
|
||||||
bash Menus/${pick_array[$pick]}.sh
|
bash "${PWD}/Menus/${pick_array[$pick]}.sh"
|
||||||
else
|
else
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user