代码语言:javascript复制
#!/bin/bash
# 安装微信和qq
qqurl="http://work.eisc.cn/ruanjian/ubuntu/deb/work/qq/"
weixinurl="http://work.eisc.cn/ruanjian/ubuntu/deb/work/weixin/"
dir="/datadisk/eisc/download/weixin"
debList=(
linuxqq_3.1.1-11223_amd64.deb
ukylin-wine_70.6.3.25_amd64.deb
ukylin-wechat_3.0.0_amd64.deb
)
sudo mkdir -p $dir ; sudo chmod 777 $dir ; cd $dir
download_deb(){
for i in ${debList[*]}
do
debname=`echo $i | awk -F"_" '{print $1}'`
debnameInstalled=`sudo dpkg -l | grep $debname`
debnameInstalledLength=${#debnameInstalled}
if [ $debnameInstalledLength -gt 1 ]
then
echo "[ok] 该包 $i 已经安装,安装信息: $debnameInstalled"
else
echo "[runing] 正在检查是否下载安装包: $i"
if [ ! -e $i ]
then
echo "[runing] 当前没有下载,正在下载包:$i"
case "$i" in
"linuxqq_3.1.1-11223_amd64.deb") wget $qqurl/$i ;;
"ukylin-wine_70.6.3.25_amd64.deb") wget $weixinurl/$i ;;
"ukylin-wechat_3.0.0_amd64.deb") wget $weixinurl/$i ;;
*) echo "该包没有定义下载地址,包: $i"
esac
else
echo "[ok] 已经下载: $i "
fi
echo "正在安装: $i"
sudo apt install -y xdotool ; sudo apt --fix-broken install -y
# 安装依赖包
sudo dpkg -i $i
fi
done
}
download_deb
cd
# 一键安装:
# wget eisc.cn/file/ubuntu/shell/server/weixin.sh; sudo chmod x weixin.sh ; ./weixin.sh