This commit is contained in:
darkclip 2026-01-09 00:01:11 +08:00
commit 9ce6211346
Signed by: hl
GPG Key ID: A948B2AA5A5D3BDB
5 changed files with 142 additions and 0 deletions

15
.SRCINFO Normal file
View File

@ -0,0 +1,15 @@
pkgbase = tink-access-one
pkgdesc = ChinaTelecom AOne (access-one) VPN
pkgver = 2.22.2
pkgrel = 1
url = https://aone.ctyun.cn/h5/ct0trust/index.html#/terminalManage/clientDownload?key=C4C330843B2111C9EE134125AF2C43FE
install = access-one.install
arch = x86_64
license = EULA
depends = libxtst
depends = nss
depends = iptables-nft
source = https://soc-0trust.ctcdn.cn/client/20250924002450-AOne-2.22.2-Ubuntu-X64-release-20250902152242.deb
sha256sums = 1d091e26632c29e48ca7fefa563d1ce491e4cb45497ea02b32defad47c199e60
pkgname = tink-access-one

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.deb
*.pkg.*

17
PKGBUILD Normal file
View File

@ -0,0 +1,17 @@
_pkgname=access-one
pkgname=tink-${_pkgname}
pkgver=2.22.2
pkgrel=1
pkgdesc="ChinaTelecom AOne (${_pkgname}) VPN"
arch=(x86_64)
url="https://aone.ctyun.cn/h5/ct0trust/index.html#/terminalManage/clientDownload?key=C4C330843B2111C9EE134125AF2C43FE"
license=(EULA)
depends=('libxtst' 'nss' 'iptables-nft')
install=${_pkgname}.install
source=('https://soc-0trust.ctcdn.cn/client/20250924002450-AOne-2.22.2-Ubuntu-X64-release-20250902152242.deb')
sha256sums=('1d091e26632c29e48ca7fefa563d1ce491e4cb45497ea02b32defad47c199e60')
package(){
tar -xf data.tar.xz -C "${pkgdir}"
}

100
access-one.install Normal file
View File

@ -0,0 +1,100 @@
pre_install(){
echo 'before install script executing...'
programDir="/opt/AOne"
processName="AOne"
echo "checking running process..."
# 检查进程是否存在
if pgrep -x "$processName" >/dev/null; then
echo "$processName is running,stopping..."
# 终止进程
killall -e $processName
fi
echo 'before install script complete'
}
post_install(){
echo 'after install script executing...'
programDir="/opt/AOne"
# 解决Ubuntu 24.04上启动时的sandbox权限报错
sudo chown root ${programDir}/chrome-sandbox
sudo chmod 4755 ${programDir}/chrome-sandbox
sudo chmod +x ${programDir}/resources/bin/ctEAO
sudo cp ${programDir}/resources/bin/aone.service /etc/systemd/system
sudo systemctl daemon-reload
sudo systemctl enable aone.service
sudo systemctl start aone.service
# 写入包的类型,用于更新时判断当前包的类型以从平台上获取更新
sudo echo "deb" > ${programDir}/pkg-type
echo 'after install script complete'
}
pre_remove(){
echo 'before remove script executing...'
programDir="/opt/AOne"
processName="AOne"
echo "checking running process..."
# 检查进程是否存在
if pgrep -x "$processName" >/dev/null; then
echo "$processName is running, stopping..."
# 终止进程
killall -e $processName
fi
# 卸载
if [ "$1" = "remove" ]; then
# 拷贝cps-agent的卸载脚本到tmp目录
if [ -f "${programDir}/resources/bin/uninst_cps.sh" ]; then
cp -f ${programDir}/resources/bin/uninst_cps.sh /tmp/uninst_cps.sh 2>/dev/null
fi
# 生成卸载标志文件
flagFile="${programDir}/resources/bin/uninstallflag.log"
if [ ! -f $flagFile ]; then
touch $flagFile
fi
fi
echo 'before remove script complete'
}
post_remove(){
echo 'after remove script executing...'
programDir="/opt/AOne"
num=`systemctl status aone|grep "Active"|grep "running"|wc -l`
if [ $num -ne 0 ]; then
sudo systemctl stop aone.service
sudo systemctl disable aone.service
fi
if [ -f /etc/systemed/system/aone.service ]; then
sudo rm -rf /etc/systemd/system/aone.service
fi
# 卸载信创主机安全
if [ "$1" = "remove" ]; then
uninst_script_path="/tmp/uninst_cps.sh"
bash_path=$(command -v bash 2>/dev/null)
if [ $? -eq 0 ] && [ -f "$uninst_script_path" ]; then
nohup "$bash_path" $uninst_script_path >/dev/null 2>&1 &
else
sudo systemctl stop cps-agent 2>/dev/null
sudo systemctl disable cps-agent 2>/dev/null
fi
fi
echo 'after remove script complete'
}

8
build.sh Executable file
View File

@ -0,0 +1,8 @@
#!/usr/bin/env bash
echo "calculating checksums..."
updpkgsums
echo "writing srcinfo..."
makepkg --printsrcinfo > .SRCINFO
echo "building pkg..."
makepkg -cf