spark-store/tool/update-upgrade/ss-update-notify-placer.sh
shenmo b0dfd6a3da !63 修复UOS未处理模拟软件源,新增ss-apt-fast ssupdate,杂项调整
修复UOS未处理模拟软件源
    删除ssinstall的apt-fast安装功能(转移到ss-apt-fast,并且不会再对UOS安装apt-fast)
    ss-apt-fast除了下载,安装和更新,全部走apt;
    ss-apt-fast现在只会在安装/下载/更新时检测是否有apt-fast并处理
    ss-apt-fast ssupdate 从服务器获取源链接后只更新星火源;
    和 ss-apt-fast ssupdate 功能重复的内容转为调用
2022-08-05 01:34:27 +00:00

61 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -e
rm -rf /tmp/spark-store-updatenum/number
LANG=en.US
#!/bin/bash
#检测网络链接畅通
function network()
{
#超时时间
local timeout=1
#目标网站
local target=www.baidu.com
#获取响应状态码
local ret_code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1`
if [ "x$ret_code" = "x200" ]; then
#网络畅通
return 0
else
#网络不畅通
return 1
fi
return 0
}
network
if [ $? -eq 1 ];then
echo "Network fail. Stop to avoid bother dpkg"
exit -1
fi
#The code above is modified from https://blog.csdn.net/yaxuan88521/article/details/120516298
curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list "https://gitee.com/deepin-community-store/repo_auto_update_script/raw/master/mirror-list-for-apt-fast/sources.list.d/sparkstore.list"
# 每日更新星火源文件
updatetext=`ss-apt-fast ssupdate`
mkdir -p /tmp/spark-store-updatenum/
isupdate=`echo ${updatetext: -5}`
if [ "$isupdate" = "date." ];then
sudo echo "0" > /tmp/spark-store-updatenum/number
exit 0
fi
update_app_number=`echo ${updatetext%package*} #从右向左截取第一个 src 后的字符串`
update_app_number=`echo ${update_app_number##*information...}`
sudo echo "$update_app_number" > /tmp/spark-store-updatenum/number