Linux常用脚本

本文最后更新于 2024年8月12日 晚上

常用脚本

安装软件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash

# 升级系统
UPDATE_SYSTEM=true

# 安装常用软件
INSTALL_SOFTWARE=true

# 安装xfce4
INSTALL_XFCE=true

# 安装并配置远程桌面
INSTALL_XRDP=true

# 更新系统
if [ "$UPDATE_SYSTEM" = true ]; then
sudo apt update && sudo apt upgrade -y
fi

# 安装常用软件
if [ "$INSTALL_SOFTWARE" = true ]; then
sudo apt install -y vim build-essential
sudo apt install -y git wget neofetch
fi

# 安装xfce4
if [ "$INSTALL_XFCE" = true ]; then
sudo apt install -y xrdp xfce4
fi

# 安装并配置远程桌面
if [ "$INSTALL_XRDP" = true ]; then
# Configure XRDP to use Xfce
sudo sed -i 's/^test -x/#test -x/' /etc/xrdp/startwm.sh
sudo bash -c 'echo "startxfce4" >> /etc/xrdp/startwm.sh'
# Restart XRDP service
sudo systemctl restart xrdp
# Enable XRDP to start on boot
sudo systemctl enable xrdp
# Allow RDP connections through the firewall
sudo ufw allow 3389/tcp
echo "XRDP installation and configuration completed."
fi

#
if [ "$INSTALL_TEXLIVE_FULL" = true ]; then
sudo apt install texlive-full fonts-wqy-zenhei
fi

Linux常用脚本
https://blog.zimablue.fun/2024/08/11/Linux常用命令与脚本/
作者
zimablue1996
发布于
2024年8月11日
许可协议