anduin revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
check.sh
@@ -6,7 +6,7 @@ cmds=( | |||
6 | 6 | # 原有命令 | |
7 | 7 | ls type which make uname lsb_release usermod nano apt sudo | |
8 | 8 | dirname basename yes printf stat diff patch dpkg dpkg-query apt-cache | |
9 | - | rsync id groups smartctl mkfs.ext4 strace nmap nc rsync | |
9 | + | rsync id groups smartctl mkfs.ext4 strace nmap rsync | |
10 | 10 | tar xz gzip file less w who whoami scp vim | |
11 | 11 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
12 | 12 | zip unzip xargs tar time zstd ssh adduser ufw man |
anduin revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
check.sh
@@ -7,7 +7,7 @@ cmds=( | |||
7 | 7 | ls type which make uname lsb_release usermod nano apt sudo | |
8 | 8 | dirname basename yes printf stat diff patch dpkg dpkg-query apt-cache | |
9 | 9 | rsync id groups smartctl mkfs.ext4 strace nmap nc rsync | |
10 | - | tar xz gzip file less w who whoami scp | |
10 | + | tar xz gzip file less w who whoami scp vim | |
11 | 11 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
12 | 12 | zip unzip xargs tar time zstd ssh adduser ufw man | |
13 | 13 | mount umount systemctl journalctl dmesg hostname hostnamectl |
anduin revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
check.sh
@@ -7,7 +7,7 @@ cmds=( | |||
7 | 7 | ls type which make uname lsb_release usermod nano apt sudo | |
8 | 8 | dirname basename yes printf stat diff patch dpkg dpkg-query apt-cache | |
9 | 9 | rsync id groups smartctl mkfs.ext4 strace nmap nc rsync | |
10 | - | tar xz gzip file less w who whoami | |
10 | + | tar xz gzip file less w who whoami scp | |
11 | 11 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
12 | 12 | zip unzip xargs tar time zstd ssh adduser ufw man | |
13 | 13 | mount umount systemctl journalctl dmesg hostname hostnamectl |
anduin revised this gist . Go to revision
1 file changed, 3 insertions
check.sh
@@ -5,6 +5,9 @@ set -euo pipefail | |||
5 | 5 | cmds=( | |
6 | 6 | # 原有命令 | |
7 | 7 | ls type which make uname lsb_release usermod nano apt sudo | |
8 | + | dirname basename yes printf stat diff patch dpkg dpkg-query apt-cache | |
9 | + | rsync id groups smartctl mkfs.ext4 strace nmap nc rsync | |
10 | + | tar xz gzip file less w who whoami | |
8 | 11 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
9 | 12 | zip unzip xargs tar time zstd ssh adduser ufw man | |
10 | 13 | mount umount systemctl journalctl dmesg hostname hostnamectl |
anduin revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
check.sh
@@ -4,7 +4,7 @@ set -euo pipefail | |||
4 | 4 | # 要检查的命令列表(包含常用的系统管理、文件操作、网络诊断等) | |
5 | 5 | cmds=( | |
6 | 6 | # 原有命令 | |
7 | - | ls type which make uname lsb_release | |
7 | + | ls type which make uname lsb_release usermod nano apt sudo | |
8 | 8 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
9 | 9 | zip unzip xargs tar time zstd ssh adduser ufw man | |
10 | 10 | mount umount systemctl journalctl dmesg hostname hostnamectl |
anduin revised this gist . Go to revision
1 file changed, 1 insertion
check.sh
@@ -4,6 +4,7 @@ set -euo pipefail | |||
4 | 4 | # 要检查的命令列表(包含常用的系统管理、文件操作、网络诊断等) | |
5 | 5 | cmds=( | |
6 | 6 | # 原有命令 | |
7 | + | ls type which make uname lsb_release | |
7 | 8 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
8 | 9 | zip unzip xargs tar time zstd ssh adduser ufw man | |
9 | 10 | mount umount systemctl journalctl dmesg hostname hostnamectl |
anduin revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
check.sh
@@ -5,7 +5,7 @@ set -euo pipefail | |||
5 | 5 | cmds=( | |
6 | 6 | # 原有命令 | |
7 | 7 | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
8 | - | zip unzip xargs tar time zstd ssh adduser ufw man vim | |
8 | + | zip unzip xargs tar time zstd ssh adduser ufw man | |
9 | 9 | mount umount systemctl journalctl dmesg hostname hostnamectl | |
10 | 10 | cat echo grep awk sed cut find ps less kmod iptables ip6tables | |
11 | 11 | netstat ss route tcpdump du chmod chown cp mv rm mkdir rmdir ln touch |
anduin revised this gist . Go to revision
1 file changed, 1 insertion, 1 deletion
check.sh
@@ -11,7 +11,7 @@ cmds=( | |||
11 | 11 | netstat ss route tcpdump du chmod chown cp mv rm mkdir rmdir ln touch | |
12 | 12 | useradd userdel groupadd groupdel passwd su sudo env uname whoami | |
13 | 13 | uptime date lsof vmstat iostat traceroute host dig | |
14 | - | tail head watch logger crontab | |
14 | + | tail head watch logger crontab ifconfig | |
15 | 15 | ) | |
16 | 16 | ||
17 | 17 | for cmd in "${cmds[@]}"; do |
anduin revised this gist . Go to revision
1 file changed, 24 insertions
check.sh(file created)
@@ -0,0 +1,24 @@ | |||
1 | + | #!/usr/bin/env bash | |
2 | + | set -euo pipefail | |
3 | + | ||
4 | + | # 要检查的命令列表(包含常用的系统管理、文件操作、网络诊断等) | |
5 | + | cmds=( | |
6 | + | # 原有命令 | |
7 | + | lspci lsusb lsblk fdisk df free top htop ip ping curl wget | |
8 | + | zip unzip xargs tar time zstd ssh adduser ufw man vim | |
9 | + | mount umount systemctl journalctl dmesg hostname hostnamectl | |
10 | + | cat echo grep awk sed cut find ps less kmod iptables ip6tables | |
11 | + | netstat ss route tcpdump du chmod chown cp mv rm mkdir rmdir ln touch | |
12 | + | useradd userdel groupadd groupdel passwd su sudo env uname whoami | |
13 | + | uptime date lsof vmstat iostat traceroute host dig | |
14 | + | tail head watch logger crontab | |
15 | + | ) | |
16 | + | ||
17 | + | for cmd in "${cmds[@]}"; do | |
18 | + | if ! command -v "$cmd" >/dev/null 2>&1; then | |
19 | + | echo "ERROR: Required command '$cmd' not found in \$PATH!" >&2 | |
20 | + | exit 1 | |
21 | + | fi | |
22 | + | done | |
23 | + | ||
24 | + | echo "✅ 系统健康检查通过:所有常用命令都可用。" |