spark-store/tool/ssinstall
shenmo 238c43b79e !85 修改: debian/spark-store.postinst 重命名: tool/ss-apt-fast -> tool/aptss
* 删除文件 spark-wine7-devel_7.14~spark-1_amd64.deb
* final
* 	修改:     debian/spark-store.postinst
* 	修改:     tool/update-upgrade/ss-update-controler.sh
* 	修改:     debian/spark-store.postinst
* 只额外生成一份给aptss
* 	修改:     debian/spark-store.postinst
*  要提交的变更:
* 	修改:     tool/aptss
* 	修改:     debian/changelog
* 	修改:     pkg/usr/share/bash-completion/completions/aptss
* 	修改:     pkg/usr/share/bash-completion/completions/aptss
* 	修改:     debian/spark-store.postinst
* aa
* Merge branch 'master' of https://gitee.com/deepin-community-store/spark-store
* 	修改:     src/main.cpp
* Merge branch 'master' of https://gitee.com/deepin-community-store/spark-store
* 	修改:     debian/spark-store.postinst
2022-08-19 07:28:10 +00:00

100 lines
3.2 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 [ ! -f "$1" ]
then
echo "文件不存在"
exit 1
fi
#################root校验+要密码
if [ "$(id -u)" != "0" ]
then
echo "ssinstall需要在root下运行";
uname=`whoami`
echo "Now input the password of $uname"
read -e upass
################检查密码对不对
echo "$upass" | sudo -S echo "i love amber forever"
passcheck=`echo "$upass" | sudo -S echo "i love amber forever"`
if [ "$passcheck" != "i love amber forever" ];then
echo "-----------------------------------------------------"
echo "E:密码错误,退出脚本!"
exit 1
fi
fi
##################apt-fast/metalink测试
DEPEND="这里一定会安装所以放弃处理"
isuos=`cat /etc/os-release | grep UnionTech`
##############判断是否是root运行如果是则正常走如果不是则代输密码
if [ "$(id -u)" != "0" ];then
#############################无root权限时
IS_INSTALLED=`which apt-fast`
if [ "$IS_INSTALLED" = "" ] ; then
echo "未安装依赖apt-fast 开始安装"
echo "$upass" | sudo -S aptss 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
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || sudo aptss 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
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用aptss进行多线程下载加速"
echo ----------------------------------------------------------------------------------
echo "$upass" | sudo -S dpkg -i $1 || sudo aptss ssupdate && sudo aptss install -yf
fi
else
###########################有root权限时
IS_INSTALLED=`which apt-fast`
if [ "$IS_INSTALLED" = "" ] ; then
echo "未安装依赖apt-fast 开始安装"
aptss 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
echo "UOS中系统依赖无法使用第三方下载工具放弃使用apt-fast"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || aptss 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
if [ "$DEPEND" != "" ] && [ "$isuos" = "" ]; then
echo "检测到apt-fast使用aptss进行多线程下载加速"
echo ----------------------------------------------------------------------------------
dpkg -i $1 || aptss ssupdate && aptss install -yf
fi
fi