aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfelinae982020-11-20 20:54:48 +0800
committerfelinae982020-11-20 20:54:48 +0800
commit6139c27687bab39ac07684741cafdf7b68e939a6 (patch)
treeb24c9ac357223ca16c28678be5ade71ea802faaa
parent9432a0807d219c01b01b575c0c9028f92c7286bd (diff)
downloadaur-6139c27687bab39ac07684741cafdf7b68e939a6.tar.gz
use daemon for update mmdb
-rw-r--r--.SRCINFO7
-rw-r--r--PKGBUILD9
-rwxr-xr-xclashup6
3 files changed, 13 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 361296b08c17..212acf7a1c13 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,17 @@
pkgbase = clashup
pkgdesc = auto update clash's config file
- pkgver = 0.2.5
- pkgrel = 2
+ pkgver = 0.2.6
+ pkgrel = 1
url = https://github.com/felinae98/clashup
arch = any
license = GPL
depends = python
depends = clash
depends = python-requests
+ depends = python-daemon
source = clashup
source = clashup.conf
- md5sums = 01b044273790887a37d8052e99cbb930
+ md5sums = 5003219768c527792b83b9412097c4c5
md5sums = 177338346005e11d33e27edc1f8ab780
pkgname = clashup
diff --git a/PKGBUILD b/PKGBUILD
index 517bd230f443..d6f2a5290a8e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,18 +1,19 @@
# Maintainer: Tang Yuming <felinae225@qq.com>
pkgname=clashup
-pkgver=0.2.5
-pkgrel=2
+pkgver=0.2.6
+pkgrel=1
pkgdesc="auto update clash's config file"
license=('GPL')
arch=('any')
url="https://github.com/felinae98/clashup"
depends=(python
clash
- python-requests)
+ python-requests
+ python-daemon)
source=(clashup clashup.conf)
package() {
install -Dm755 clashup ${pkgdir}/usr/bin/clashup
install -Dm644 clashup.conf ${pkgdir}/etc/systemd/user/clash.service.d/clashup.conf
}
-md5sums=('01b044273790887a37d8052e99cbb930'
+md5sums=('5003219768c527792b83b9412097c4c5'
'177338346005e11d33e27edc1f8ab780')
diff --git a/clashup b/clashup
index 1953ef07d152..211d3ec3032c 100755
--- a/clashup
+++ b/clashup
@@ -10,6 +10,7 @@ import time
import argparse
import subprocess
import hashlib
+import daemon
logging.basicConfig(format='%(asctime)s %(levelname)s: %(message)s', level=logging.INFO)
@@ -141,12 +142,13 @@ class ClashUp:
args = parser.parse_args()
self.load_conf()
if args.pre:
- if self.config.get('mmdb_version_url') and self.config.get('mmdb_file_url'):
- self.update_mmdb()
if self.config['is_subscribe_banned']:
logging.info('Subscribe is banned, pass this run')
else:
self.update(False)
+ if self.config.get('mmdb_version_url') and self.config.get('mmdb_file_url'):
+ with daemon.DaemonContext():
+ self.update_mmdb()
elif args.post:
if self.config['is_subscribe_banned']:
if self.update_time_cache():