diff options
author | felinae98 | 2020-11-20 20:54:48 +0800 |
---|---|---|
committer | felinae98 | 2020-11-20 20:54:48 +0800 |
commit | 6139c27687bab39ac07684741cafdf7b68e939a6 (patch) | |
tree | b24c9ac357223ca16c28678be5ade71ea802faaa | |
parent | 9432a0807d219c01b01b575c0c9028f92c7286bd (diff) | |
download | aur-6139c27687bab39ac07684741cafdf7b68e939a6.tar.gz |
use daemon for update mmdb
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 9 | ||||
-rwxr-xr-x | clashup | 6 |
3 files changed, 13 insertions, 9 deletions
@@ -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 @@ -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') @@ -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(): |