mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-15 21:32:05 +08:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e88f7c1eb | |||
| b639a9d726 | |||
| e2f6a2b3c2 | |||
| c826a3927c | |||
| 0c367799b7 | |||
| 114b5cdfe5 | |||
| a563d99bc4 | |||
| b1cb765b6e | |||
| 49c5583ea9 |
24
debian/changelog
vendored
24
debian/changelog
vendored
@@ -1,4 +1,28 @@
|
|||||||
|
spark-store (3.1.4-2) stable; urgency=medium
|
||||||
|
|
||||||
|
* 客户端下载使用metalink来支持bt下载加速
|
||||||
|
* 修复使用更新和安装设置更新商店本体时出错
|
||||||
|
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
spark-store (3.1.4-1) stable; urgency=medium
|
||||||
|
|
||||||
|
* 安装脚本和检测更新脚本检查网络时间超时时间延长至5s
|
||||||
|
* 修复:ssinstall在没有安装apt-fast的情况下首次安装需要依赖的软件时安装失败
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
|
spark-store (3.1.4) stable; urgency=medium
|
||||||
|
|
||||||
|
* 发布正式版,同步到官网
|
||||||
|
* 修复安装时使用wget的问题
|
||||||
|
* 合并3.1.3-1和3.1.3-2的更改
|
||||||
|
* 屏蔽了ssinstall之外的安装方式
|
||||||
|
* 调整了报错框的形式
|
||||||
|
* 修复pkexec下ssinstall不处理依赖
|
||||||
|
|
||||||
|
-- shenmo <shenmo@spark-app.store> Fri, 30 Jan 2022 00:00:00 +0800
|
||||||
|
|
||||||
spark-store (3.1.3-2) stable; urgency=medium
|
spark-store (3.1.3-2) stable; urgency=medium
|
||||||
|
|
||||||
|
|||||||
2
debian/spark-store.postinst
vendored
2
debian/spark-store.postinst
vendored
@@ -16,7 +16,7 @@ case "$1" in
|
|||||||
|
|
||||||
|
|
||||||
# Download and install key
|
# Download and install key
|
||||||
wget -O /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc
|
curl --progress-bar -o /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc
|
||||||
gpg --dearmor /tmp/spark-store-install/spark-store.asc
|
gpg --dearmor /tmp/spark-store-install/spark-store.asc
|
||||||
cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg
|
cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg
|
||||||
|
|
||||||
|
|||||||
2
debian/spark-store.preinst
vendored
2
debian/spark-store.preinst
vendored
@@ -3,7 +3,7 @@
|
|||||||
function network-check()
|
function network-check()
|
||||||
{
|
{
|
||||||
#超时时间
|
#超时时间
|
||||||
local timeout=1
|
local timeout=5
|
||||||
|
|
||||||
#目标网站
|
#目标网站
|
||||||
local target=www.baidu.com
|
local target=www.baidu.com
|
||||||
|
|||||||
@@ -45,18 +45,18 @@ downloadlist::downloadlist(QWidget *parent) :
|
|||||||
menu_install->addAction(action_dpkg);
|
menu_install->addAction(action_dpkg);
|
||||||
}
|
}
|
||||||
|
|
||||||
QFile deepin("/usr/bin/deepin-deb-installer");
|
// QFile deepin("/usr/bin/deepin-deb-installer");
|
||||||
deepin.open(QIODevice::ReadOnly);
|
// deepin.open(QIODevice::ReadOnly);
|
||||||
if(deepin.isOpen())
|
// if(deepin.isOpen())
|
||||||
{
|
// {
|
||||||
menu_install->addAction(action_deepin);
|
// menu_install->addAction(action_deepin);
|
||||||
}
|
// }
|
||||||
QFile gdebi("/usr/bin/gdebi");
|
// QFile gdebi("/usr/bin/gdebi");
|
||||||
gdebi.open(QIODevice::ReadOnly);
|
// gdebi.open(QIODevice::ReadOnly);
|
||||||
if(gdebi.isOpen())
|
// if(gdebi.isOpen())
|
||||||
{
|
// {
|
||||||
menu_install->addAction(action_gdebi);
|
// menu_install->addAction(action_gdebi);
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,6 +219,7 @@ void downloadlist::on_pushButton_3_clicked()
|
|||||||
{
|
{
|
||||||
textbrowser->setLineWidth(0);
|
textbrowser->setLineWidth(0);
|
||||||
textbrowser->setText(out);
|
textbrowser->setText(out);
|
||||||
|
textbrowser->setMinimumHeight(500);
|
||||||
|
|
||||||
output_w->setMinimumHeight(600);
|
output_w->setMinimumHeight(600);
|
||||||
output_w->setAttribute(Qt::WA_TranslucentBackground);
|
output_w->setAttribute(Qt::WA_TranslucentBackground);
|
||||||
|
|||||||
@@ -44,6 +44,48 @@ void timeSleeper(int time)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool checkMeatlink(QString metaUrl)
|
||||||
|
{
|
||||||
|
QFile metaStatus("/tmp/spark-store/metaStatus.txt");
|
||||||
|
if (metaStatus.exists())
|
||||||
|
{
|
||||||
|
metaStatus.remove();
|
||||||
|
}
|
||||||
|
system("curl -I -s --connect-timeout 5 " + metaUrl.toUtf8() + " -w %{http_code} |tail -n1 > /tmp/spark-store/metaStatus.txt");
|
||||||
|
if (metaStatus.open(QFile::ReadOnly) && QString(metaStatus.readAll()).toUtf8() == "200")
|
||||||
|
{
|
||||||
|
metaStatus.remove();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gennerateDomain(QVector<QString> &domains)
|
||||||
|
{
|
||||||
|
QFile serverList(QDir::homePath().toUtf8() + "/.config/spark-store/server.list");
|
||||||
|
if (serverList.open(QFile::ReadOnly))
|
||||||
|
{
|
||||||
|
QStringList list = QString(serverList.readAll()).trimmed().split("\n");
|
||||||
|
qDebug() << list << list.size();
|
||||||
|
domains.clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < list.size(); i++)
|
||||||
|
{
|
||||||
|
if (list.at(i).contains("镜像源 Download only") && i + 1 < list.size())
|
||||||
|
{
|
||||||
|
for (int j = i + 1; j < list.size(); j++)
|
||||||
|
{
|
||||||
|
domains.append(list.at(j));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (domains.size() == 0)
|
||||||
|
{
|
||||||
|
domains.append("d.store.deepinos.org.cn");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 开始下载
|
* @brief 开始下载
|
||||||
@@ -59,54 +101,37 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QtConcurrent::run([=]()
|
QtConcurrent::run([=]()
|
||||||
{
|
{
|
||||||
QFile serverList(QDir::homePath().toUtf8() + "/.config/spark-store/server.list");
|
QString metaUrl = url + ".metalink";
|
||||||
if (serverList.open(QFile::ReadOnly))
|
qDebug() << "metalink" << metaUrl;
|
||||||
{
|
bool useMetalink = false;
|
||||||
QStringList list = QString(serverList.readAll()).trimmed().split("\n");
|
if (checkMeatlink(metaUrl)){
|
||||||
qDebug() << list << list.size();
|
useMetalink = true;
|
||||||
domains.clear();
|
qDebug() << "useMetalink:" << useMetalink;
|
||||||
|
}else{
|
||||||
for (int i = 0; i < list.size(); i++)
|
gennerateDomain(domains);
|
||||||
{
|
// qDebug() << domains << domains.size();
|
||||||
if (list.at(i).contains("镜像源 Download only") && i + 1 < list.size())
|
|
||||||
{
|
|
||||||
for (int j = i + 1; j < list.size(); j++)
|
|
||||||
{
|
|
||||||
system("curl -I -s --connect-timeout 5 https://" + list.at(j).toUtf8() + "/dcs-repo.gpg-key.asc -w %{http_code} |tail -n1 > /tmp/spark-store/cdnStatus.txt");
|
|
||||||
QFile cdnStatus("/tmp/spark-store/cdnStatus.txt");
|
|
||||||
if (cdnStatus.open(QFile::ReadOnly) && QString(cdnStatus.readAll()).toUtf8() == "200")
|
|
||||||
{
|
|
||||||
qDebug() << list.at(j);
|
|
||||||
domains.append(list.at(j));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (domains.size() == 0)
|
|
||||||
{
|
|
||||||
domains.append("d.store.deepinos.org.cn");
|
|
||||||
}
|
|
||||||
qDebug() << domains << domains.size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDir tmpdir("/tmp/spark-store/");
|
QDir tmpdir("/tmp/spark-store/");
|
||||||
QString aria2Command = "-d";
|
QString aria2Command = "-d";
|
||||||
QString aria2Urls = "";
|
QString aria2Urls = "";
|
||||||
QString aria2Verbose = "--summary-interval=1";
|
QString aria2Verbose = "--summary-interval=1";
|
||||||
QString aria2Threads = "-s " + QString::number(domains.size());
|
QString aria2Threads = "--split=16";
|
||||||
QString aria2NoConfig = "--no-conf";
|
QString aria2NoConfig = "--no-conf";
|
||||||
|
QString aria2NoSeeds = "--seed-time=0";
|
||||||
QStringList command;
|
QStringList command;
|
||||||
QString downloadDir = "/tmp/spark-store/";
|
QString downloadDir = "/tmp/spark-store/";
|
||||||
|
|
||||||
|
if (useMetalink){
|
||||||
for (int i = 0; i < domains.size(); i++)
|
command.append(metaUrl.toUtf8());
|
||||||
{
|
|
||||||
command.append(replaceDomain(url, domains.at(i)).toUtf8());
|
|
||||||
aria2Urls += replaceDomain(url, domains.at(i));
|
|
||||||
aria2Urls += " ";
|
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
for (int i = 0; i < domains.size(); i++)
|
||||||
|
{
|
||||||
|
command.append(replaceDomain(url, domains.at(i)).toUtf8());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
qint64 downloadSizeRecord = 0;
|
qint64 downloadSizeRecord = 0;
|
||||||
QString speedInfo = "";
|
QString speedInfo = "";
|
||||||
@@ -114,8 +139,11 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
command.append(aria2Command.toUtf8());
|
command.append(aria2Command.toUtf8());
|
||||||
command.append(downloadDir.toUtf8());
|
command.append(downloadDir.toUtf8());
|
||||||
command.append(aria2Verbose.toUtf8());
|
command.append(aria2Verbose.toUtf8());
|
||||||
command.append(aria2Threads.toUtf8());
|
|
||||||
command.append(aria2NoConfig.toUtf8());
|
command.append(aria2NoConfig.toUtf8());
|
||||||
|
command.append(aria2Threads.toUtf8());
|
||||||
|
if (useMetalink){
|
||||||
|
command.append(aria2NoSeeds.toUtf8());
|
||||||
|
}
|
||||||
qDebug() << command;
|
qDebug() << command;
|
||||||
auto cmd = new QProcess();
|
auto cmd = new QProcess();
|
||||||
cmd->setProcessChannelMode(QProcess::MergedChannels);
|
cmd->setProcessChannelMode(QProcess::MergedChannels);
|
||||||
@@ -130,6 +158,7 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
//通过读取输出计算下载速度
|
//通过读取输出计算下载速度
|
||||||
QFileInfo info(tmpdir.absoluteFilePath(filename));
|
QFileInfo info(tmpdir.absoluteFilePath(filename));
|
||||||
QString message = cmd->readAllStandardOutput().data();
|
QString message = cmd->readAllStandardOutput().data();
|
||||||
|
//qDebug() << message;
|
||||||
message = message.replace(" ", "").replace("\n", "").replace("-", "");
|
message = message.replace(" ", "").replace("\n", "").replace("-", "");
|
||||||
message = message.replace("*", "").replace("=", "");
|
message = message.replace("*", "").replace("=", "");
|
||||||
QStringList list;
|
QStringList list;
|
||||||
@@ -153,7 +182,7 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
speedInfo = message.mid(speedPlace1 + 3, speedPlace2 - speedPlace1 - 3);
|
speedInfo = message.mid(speedPlace1 + 3, speedPlace2 - speedPlace1 - 3);
|
||||||
speedInfo += "/s";
|
speedInfo += "/s";
|
||||||
}
|
}
|
||||||
qDebug() << percentInfo << speedInfo;
|
// qDebug() << percentInfo << speedInfo;
|
||||||
if (downloadSize >= downloadSizeRecord)
|
if (downloadSize >= downloadSizeRecord)
|
||||||
{
|
{
|
||||||
downloadSizeRecord = downloadSize;
|
downloadSizeRecord = downloadSize;
|
||||||
@@ -182,8 +211,7 @@ void DownloadController::startDownload(const QString &url)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
emit downloadFinished();
|
emit downloadFinished(); });
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ int main(int argc, char *argv[])
|
|||||||
DAboutDialog dialog;
|
DAboutDialog dialog;
|
||||||
a.setAboutDialog(&dialog);
|
a.setAboutDialog(&dialog);
|
||||||
dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
|
dialog.setLicense(QObject::tr("We publish this program under GPL V3"));
|
||||||
dialog.setVersion(DApplication::buildVersion("Version 3.1.3-2"));
|
dialog.setVersion(DApplication::buildVersion("Version 3.1.4-2"));
|
||||||
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
|
dialog.setProductIcon(QIcon::fromTheme("spark-store")); // 设置Logo
|
||||||
dialog.setProductName(QLabel::tr("Spark Store"));
|
dialog.setProductName(QLabel::tr("Spark Store"));
|
||||||
dialog.setDescription(
|
dialog.setDescription(
|
||||||
@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
|||||||
a.setOrganizationName("spark-union");
|
a.setOrganizationName("spark-union");
|
||||||
a.setOrganizationDomain("https://www.deepinos.org/");
|
a.setOrganizationDomain("https://www.deepinos.org/");
|
||||||
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
|
||||||
a.setApplicationVersion(DApplication::buildVersion("3.1.3-2"));
|
a.setApplicationVersion(DApplication::buildVersion("3.1.4-2"));
|
||||||
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
|
||||||
a.setApplicationDescription(
|
a.setApplicationDescription(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "download" ] ; then
|
if [ "$1" = "install" ] || [ "$1" = "upgrade" ] || [ "$1" = "full-upgrade" ] || [ "$1" = "download" ] ; then
|
||||||
|
|
||||||
###刷新apt-fast配置
|
###刷新apt-fast配置
|
||||||
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
||||||
@@ -18,7 +18,7 @@ chmod -R 755 /tmp/ss-apt-fast-conf
|
|||||||
DEPEND=`which apt-fast`
|
DEPEND=`which apt-fast`
|
||||||
if [ "$DEPEND" = "" ] ; then
|
if [ "$DEPEND" = "" ] ; then
|
||||||
echo "未安装依赖:apt-fast 开始安装"
|
echo "未安装依赖:apt-fast 开始安装"
|
||||||
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
sudo ss-apt-fast ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||||
fi
|
fi
|
||||||
###执行安装
|
###执行安装
|
||||||
bwrap --dev-bind / / \
|
bwrap --dev-bind / / \
|
||||||
|
|||||||
@@ -47,20 +47,25 @@ isuos=`cat /etc/os-release | grep UnionTech`
|
|||||||
if [ "$(id -u)" != "0" ];then
|
if [ "$(id -u)" != "0" ];then
|
||||||
#############################无root权限时
|
#############################无root权限时
|
||||||
|
|
||||||
|
IS_INSTALLED=`which apt-fast`
|
||||||
|
if [ "$IS_INSTALLED" = "" ] ; then
|
||||||
|
echo "未安装依赖:apt-fast 开始安装"
|
||||||
|
echo "$upass" | sudo -S /usr/local/bin/ss-apt-fast ssupdate && echo "$upass" | sudo -S bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
|
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
|
||||||
echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast"
|
echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast"
|
||||||
echo ----------------------------------------------------------------------------------
|
echo ----------------------------------------------------------------------------------
|
||||||
echo "$upass" | sudo -S dpkg -i $1 || sudo ss-apt-fast ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
echo "$upass" | sudo -S dpkg -i $1 || sudo /usr/local/bin/ss-apt-fast ssupdate && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
||||||
|
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
|
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
|
||||||
echo "检测到apt-fast,使用ss-apt-fast进行多线程下载加速"
|
echo "检测到apt-fast,使用/usr/local/bin/ss-apt-fast进行多线程下载加速"
|
||||||
echo ----------------------------------------------------------------------------------
|
echo ----------------------------------------------------------------------------------
|
||||||
echo "$upass" | sudo -S dpkg -i $1 || sudo ss-apt-fast ssupdate && sudo ss-apt-fast install -yf
|
echo "$upass" | sudo -S dpkg -i $1 || sudo /usr/local/bin/ss-apt-fast ssupdate && sudo /usr/local/bin/ss-apt-fast install -yf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@@ -70,19 +75,22 @@ fi
|
|||||||
else
|
else
|
||||||
###########################有root权限时
|
###########################有root权限时
|
||||||
|
|
||||||
|
IS_INSTALLED=`which apt-fast`
|
||||||
|
if [ "$IS_INSTALLED" = "" ] ; then
|
||||||
|
echo "未安装依赖:apt-fast 开始安装"
|
||||||
|
/usr/local/bin/ss-apt-fast ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install apt-fast -y
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
|
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
|
||||||
echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast"
|
echo "UOS中系统依赖无法使用第三方下载工具,放弃使用apt-fast"
|
||||||
echo ----------------------------------------------------------------------------------
|
echo ----------------------------------------------------------------------------------
|
||||||
dpkg -i $1 || ss-apt-fast ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
dpkg -i $1 || /usr/local/bin/ss-apt-fast ssupdate && bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt update && sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list apt install -yf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
|
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
|
||||||
echo "检测到apt-fast,使用ss-apt-fast进行多线程下载加速"
|
echo "检测到apt-fast,使用/usr/local/bin/ss-apt-fast进行多线程下载加速"
|
||||||
echo ----------------------------------------------------------------------------------
|
echo ----------------------------------------------------------------------------------
|
||||||
dpkg -i $1 || ss-apt-fast ssupdate && ss-apt-fast install -yf
|
dpkg -i $1 || /usr/local/bin/ss-apt-fast ssupdate && /usr/local/bin/ss-apt-fast install -yf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ if [ "$yes_or_no" = "y" ];then
|
|||||||
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
mkdir -p /tmp/ss-apt-fast-conf/sources.list.d
|
||||||
|
|
||||||
|
|
||||||
sudo bwrap --dev-bind / / --bind '/opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d/sparkstore.list' /etc/apt/sources.list.d/sparkstore.list ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
sudo ss-apt-fast upgrade -y -o Dir::Etc::sourcelist="sources.list.d/sparkstore.list" -o Dir::Etc::sourceparts="-" -o APT::Get::List-Cleanup="0"
|
||||||
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ LANG=en.US
|
|||||||
function network()
|
function network()
|
||||||
{
|
{
|
||||||
#超时时间
|
#超时时间
|
||||||
local timeout=1
|
local timeout=5
|
||||||
|
|
||||||
#目标网站
|
#目标网站
|
||||||
local target=www.baidu.com
|
local target=www.baidu.com
|
||||||
|
|||||||
Reference in New Issue
Block a user