mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-13 20:32:05 +08:00
aptss支持非root模式启动,添加transhell支持
This commit is contained in:
30
tool/aptss
30
tool/aptss
@@ -1,5 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
source /opt/durapps/spark-store/bin/bashimport/transhell.amber
|
||||
load_transhell
|
||||
|
||||
case `arch` in
|
||||
x86_64)
|
||||
STORE_URL="store"
|
||||
@@ -10,21 +13,23 @@ case `arch` in
|
||||
STORE_LIST_URL="-aarch64"
|
||||
;;
|
||||
esac
|
||||
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
|
||||
|
||||
|
||||
is_empty_dir(){
|
||||
return `ls -A $1|wc -w`
|
||||
}
|
||||
|
||||
SS_APT_FAST="/opt/durapps/spark-store/bin/apt-fast/ss-apt-fast"
|
||||
|
||||
|
||||
if [ "$(id -u)" != "0" ];then
|
||||
#############################无root权限时
|
||||
echo "Please run me as root.请使用root权限启动"
|
||||
exit 1
|
||||
fi
|
||||
echo "${TRANSHELL_CONTENT_RUNNING_IN_NOT_ROOT_USER}"
|
||||
|
||||
else
|
||||
|
||||
if is_empty_dir /etc/apt/sources.list.d/ ;then
|
||||
echo "sourecs.list.d dircetory is empty!"
|
||||
echo "${TRANSHELL_CONTENT_INFO_SOURCES_LIST_D_IS_EMPTY}"
|
||||
else
|
||||
ln -sf /etc/apt/sources.list.d/* /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d
|
||||
###让这里和系统同步,先链接,然后清除无效链接
|
||||
@@ -37,11 +42,12 @@ for a in `find /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d -type l
|
||||
done
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ ! -e "/tmp/aptss-conf/apt-fast.conf" ];then
|
||||
###刷新apt-fast配置
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
@@ -50,11 +56,9 @@ fi
|
||||
|
||||
|
||||
if [ ! -e "/var/lib/aptss/lists/d.spark-app.store_${STORE_URL}_Packages" ] && [ ! -e "/var/lib/aptss/lists/d.store.deepinos.org.cn_${STORE_URL}_Packages" ] && [ ! -e "/var/lib/aptss/lists/mirrors.sdu.edu.cn_spark-store-repository_${STORE_URL}_Packages" ];then
|
||||
echo "接收星火仓库软件信息中..."
|
||||
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
@@ -97,8 +101,7 @@ elif [ "$1" = "policy" ] || [ "$1" = "search" ];then
|
||||
elif [ "$1" = "ssupdate" ];then
|
||||
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
|
||||
echo
|
||||
curl --silent -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
@@ -115,8 +118,7 @@ curl --progress-bar -o /opt/durapps/spark-store/bin/apt-fast-conf/sources.list.d
|
||||
|
||||
|
||||
mkdir -p /tmp/aptss-conf/
|
||||
echo "从服务器获取配置和镜像列表..."
|
||||
echo "Getting server and mirror lists..."
|
||||
echo "${TRANSHELL_CONTENT_GETTING_SERVER_CONFIG_AND_MIRROR_LIST}"
|
||||
echo
|
||||
curl --progress-bar -o /tmp/aptss-conf/apt-fast.conf "https://d.store.deepinos.org.cn/apt-fast.conf"
|
||||
chmod -R 755 /tmp/aptss-conf
|
||||
|
||||
Reference in New Issue
Block a user