Update diy.sh
This commit is contained in:
parent
768ceb8dd7
commit
dfd259be4b
23
shell/diy.sh
23
shell/diy.sh
@ -56,13 +56,30 @@ InitBanner() {
|
|||||||
echo -e ""
|
echo -e ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 函数:检查并启动 SSH
|
||||||
enable_ssh() {
|
enable_ssh() {
|
||||||
echo "启用SSH服务"
|
# 检查 openssh-server 是否安装
|
||||||
|
if dpkg -l | grep -q openssh-server; then
|
||||||
|
echo "openssh-server 已安装。"
|
||||||
|
else
|
||||||
|
echo "openssh-server 未安装,正在安装..."
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
apt list --upgradable
|
|
||||||
sudo apt-get install openssh-server -y
|
sudo apt-get install openssh-server -y
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 启动 SSH 服务
|
||||||
|
sudo systemctl start ssh
|
||||||
|
echo "SSH 服务已启动。"
|
||||||
|
|
||||||
|
# 设置 SSH 服务开机自启
|
||||||
|
sudo systemctl enable ssh
|
||||||
|
echo "SSH 服务已设置为开机自启。"
|
||||||
|
|
||||||
|
# 显示 SSH 服务状态
|
||||||
|
sudo systemctl status ssh
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#安装常用办公必备软件(office、QQ、微信、远程桌面等)
|
#安装常用办公必备软件(office、QQ、微信、远程桌面等)
|
||||||
install_need_apps() {
|
install_need_apps() {
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@ -349,7 +366,6 @@ do_autostart_vm() {
|
|||||||
# 删除临时文件
|
# 删除临时文件
|
||||||
rm "$TMP_VM_LIST"
|
rm "$TMP_VM_LIST"
|
||||||
|
|
||||||
|
|
||||||
# 去掉开机提示:解锁您的开机密钥环
|
# 去掉开机提示:解锁您的开机密钥环
|
||||||
sudo rm -rf ~/.local/share/keyrings/*
|
sudo rm -rf ~/.local/share/keyrings/*
|
||||||
# 显示/etc/rc.local的内容
|
# 显示/etc/rc.local的内容
|
||||||
@ -357,7 +373,6 @@ do_autostart_vm() {
|
|||||||
cat /etc/rc.local
|
cat /etc/rc.local
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
declare -a menu_options
|
declare -a menu_options
|
||||||
declare -A commands
|
declare -A commands
|
||||||
menu_options=(
|
menu_options=(
|
||||||
|
Loading…
Reference in New Issue
Block a user