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