This commit is contained in:
Wang Sen Di
2025-11-24 13:58:48 +08:00
parent f209a45429
commit e2c4ed6c27

View File

@@ -8,21 +8,28 @@ __kill_process() {
pkill -f "lotso run" 2>/dev/null
}
__download_lotso() {
_tmp_path="${_lotso_path}.tmp"
curl -sSfLk http://dl.snodehub.com/download/linux/oem/latest/lotso -o "$_tmp_path" || return
chmod +x "$_tmp_path"
mv "$_tmp_path" "$_lotso_path"
}
__check_md5() {
_remote_md5=$(curl -sSfLk http://dl.snodehub.com/download/linux/oem/latest/lotso.md5 || echo "")
[[ -z "$_remote_md5" ]] && return
if [[ ! -f "$_lotso_path" ]]; then
curl -sSfLk http://dl.snodehub.com/download/linux/oem/latest/lotso -o "$_lotso_path"
chmod +x "$_lotso_path"
__download_lotso
return
fi
_local_md5=$(md5sum "$_lotso_path" | cut -d' ' -f1)
if [[ "$_remote_md5" != "$_local_md5" ]]; then
curl -sSfLk http://dl.snodehub.com/download/linux/oem/latest/lotso -o "$_lotso_path"
chmod +x "$_lotso_path"
__download_lotso
__kill_process
fi
}