spark-store/tool/ssinstall
shenmo 873a83e6b9 修改: debian/changelog
新文件:   pkg/usr/share/polkit-1/actions/store.spark-app.ssinstall.policy
	修改:     spark-store-project.pro
	修改:     src/main.cpp
	修改:     tool/ssinstall
2022-04-25 13:34:25 +08:00

52 lines
1.5 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
#将来可能可以换成apt-metalink来直接用种子/链接下载
echo "Spark Store Install script.星火商店安装脚本"
if [ $# -eq 0 ];then
echo "没有接收到参数,退出"
echo "用法:$0 deb路径"
exit
fi
if [ "$(id -u)" != "0" ]
then
echo "ssinstall需要在root下运行";
exit
fi
if [ ! -f "$1" ]
then
echo "文件不存在"
exit
fi
DEPEND=`which apt-fast`
isuos=`cat /etc/os-release | grep UnionTech`
#临时提升星火源的优先级
sed -i 's/400/500/g' /etc/apt/preferences.d/sparkstore
if [ "$DEPEND" = "" ] ; then
echo "没有检测到apt-fast组件将会使用单线程下载依赖"
echo "你可以安装apt-fast来加速下载对UOS无效"
echo "若要使用apt-fast加速下载请在安装apt-fast时选择使用apt并选择略过确认对话框"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf || dpkg -P $1
fi
if [ "$DEPEND" != "" ] && [ "$isuos" != "" ]; then
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt install -yf || dpkg -P $1
fi
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用apt-fast进行多线程下载加速"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || apt-fast install -yf || dpkg -P $1
fi
sed -i 's/500/400/g' /etc/apt/preferences.d/sparkstore
#恢复优先级