代码拉取完成,页面将自动刷新
#!/bin/bash
set -e
#使用颜色打印函数
source ~/.colorc
do_install()
{
swarn "Install $1 [CHECK]"
depends_str=$(apt-cache depends $1 | grep Depends | awk '{print $2}')
if [ -n "${depends_str}" ]; then
snote "Depends:"
sinfo "${depends_str}"
else
snote "Depends: nothing"
fi
swarn "Install $1 [START]"
#sudo apt-get install -y $1 > /dev/null 2>&1
sudo apt-get install -y $1
if [ $? -eq 0 ]; then
sdone "Install $1 [OK]"
else
serro "Install $1 [ERROR]"
exit 1
fi
}
do_python3_install()
{
swarn "Instal python3 [START]"
set +e
if [ ! -e /usr/local/bin/python3 ]; then
do_install python3
sudo update-alternatives --remove-all python
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 50
else
sudo update-alternatives --remove-all python
sudo update-alternatives --install /usr/bin/python python /usr/local/bin/python3 50
fi
python --version
sdone "Instal python3 [DONE]"
}
do_pip3_install()
{
swarn "Instal python3-pip [START]"
do_install python3-pip
sdone "Instal python3-pip [DONE]"
}
pip3_modules_install()
{
swarn "Instal python3 modules [START]"
sudo pip3 install pyserial
sudo pip3 install future
sudo pip3 install cryptography
sdone "Instal python3 modules [DONE]"
}
do_python3_install
#do_pip3_install
#pip3_modules_install
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。