From 884853a8119529c129da33b93285ed306e8b51b1 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Mon, 13 Nov 2023 14:17:21 +0800 Subject: [PATCH] amazon --- install/install_plugins.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/install/install_plugins.sh b/install/install_plugins.sh index 4b3501f5..8e105ef7 100644 --- a/install/install_plugins.sh +++ b/install/install_plugins.sh @@ -51,13 +51,20 @@ versions_local_file="$install_path/version.json" versions_url="$source_github_pages/version.json" file_suffix=".zip" plugin_path="/usr/share/cockpit" +modules=("requests") if ! command -v python3 &> /dev/null then echo "Python 3 is not installed. Installing..." sudo yum install -y python3 &> /dev/null || sudo apt update -y && sudo apt install -y python3 &> /dev/null - pip3 install requests fi +for module in "${modules[@]}" +do + python3 -c "import $module" &> /dev/null + if [ $? -ne 0 ]; then + pip3 install $module + fi +done echo "$echo_prefix_plugins Starting download plugin and update it"