Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dcu_env_check
Commits
b46b6eb2
Commit
b46b6eb2
authored
Jun 24, 2025
by
liumg
Browse files
Upload New File
parent
23e65b6a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
tools/pkg_check.sh
tools/pkg_check.sh
+21
-0
No files found.
tools/pkg_check.sh
0 → 100644
View file @
b46b6eb2
#!/bin/bash
function
pkg_check
()
{
local
pkgs_debian
=(
dmidecode lshw pciutils numactl-devel ipmitool locate
)
local
pkgs_centos
=(
dmidecode lshw pciutils numactl-dev ipmitool mlocate
)
local
cmd
=(
dmidecode lshw lspci numactl ipmitool locate
)
for
((
i
=
0
;
i<
${#
cmd
[@]
}
;
i++
))
;
do
if
!
command
-v
${
cmd
[i]
}
&>/dev/null
;
then
if
command
-v
apt-get &>/dev/null
;
then
echo
"没有
${
cmd
[i]
}
命令,请先安装
${
pkgs_debian
[i]
}
"
exit
0
# apt-get install -y ${pkgs_debian[i]}
elif
command
-v
yum &>/dev/null
;
then
echo
"没有
${
cmd
[i]
}
命令,请先安装
${
pkgs_centos
[i]
}
"
# yum install -y ${pkgs_centos[i]}
exit
0
fi
fi
done
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment