Skip to content

Commit 63ec31f

Browse files
committed
use lftp with command file
1 parent 4fe68ba commit 63ec31f

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

common/ffmwu_defaults.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ web:
119119
- ['h', 'hourly']
120120
- ['t', 'top10']
121121
openwrt:
122+
lftp_conf: 'lftp_commands'
122123
remote_repo_url: 'http://downloads.openwrt.org'
123124
bb_stable_dir: '/barrier_breaker/14.07'
124125
local_repo_dir: '/var/www/openwrt_mirror/barrier_breaker/'

common/lftp_commands

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
open http://downloads.openwrt.org
2+
mirror --delete /barrier_breaker/14.07 /var/www/openwrt_mirror/barrier_breaker/
3+
quit

mirror_openwrt_repo_srv.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#!/usr/bin/env python3
22

33
def mirror_openwrt_repo():
4+
from os import path
45
from photon.util.files import read_file
56
from common import pinit
67

78
photon, settings = pinit('mirror_openwrt_repo', verbose=True)
89

10+
lftp_conf = path.join(path.dirname(__file__), 'common', settings['openwrt']['lftp_conf'])
11+
912
config_content=photon.m(
1013
'mirror openwrt repo dir %s%s' %(settings['openwrt']['remote_repo_url'], settings['openwrt']['bb_stable_dir']),
1114
cmdd=dict(
12-
cmd='lftp %s -e "mirror --delete %s %s"' %(settings['openwrt']['remote_repo_url'], settings['openwrt']['bb_stable_dir'], settings['openwrt']['local_repo_dir']),
15+
cmd='lftp -f %s' %(lftp_conf),
1316
)
1417
).get('out')
1518

0 commit comments

Comments
 (0)