File tree Expand file tree Collapse file tree
htdocs/luci-static/resources/view/mosdns Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11include $(TOPDIR ) /rules.mk
22
33PKG_NAME: =luci-app-mosdns
4- PKG_VERSION: =1.7.0
4+ PKG_VERSION: =1.7.1
55PKG_RELEASE: =1
66
77LUCI_TITLE: =LuCI Support for mosdns
Original file line number Diff line number Diff line change @@ -391,10 +391,7 @@ return view.extend({
391391 if ( value == formvalue ) {
392392 return ;
393393 }
394- return fs . write ( '/etc/mosdns/rule/cloudflare-cidr.txt' , formvalue . trim ( ) . replace ( / \r \n / g, '\n' ) + '\n' )
395- . then ( function ( i ) {
396- return fs . exec ( '/etc/init.d/mosdns' , [ 'restart' ] ) ;
397- } ) ;
394+ return fs . write ( '/etc/mosdns/rule/cloudflare-cidr.txt' , formvalue . trim ( ) . replace ( / \r \n / g, '\n' ) + '\n' ) ;
398395 } ) ;
399396 } ;
400397
Original file line number Diff line number Diff line change 33'require fs' ;
44'require ui' ;
55'require view' ;
6- 'require rpc' ;
7-
8- var callRestart = rpc . declare ( {
9- object : 'luci.mosdns' ,
10- method : 'restart'
11- } ) ;
126
137return view . extend ( {
148 render : function ( ) {
@@ -274,19 +268,9 @@ return view.extend({
274268 } ,
275269
276270 handleSaveApply : function ( ev ) {
277- var m = this . map ;
278- onclick = L . bind ( this . handleSave , this , m ) ;
279- return callRestart ( )
280- . then ( function ( res ) {
281- if ( res && res . code === 0 ) {
282- window . location . reload ( ) ;
283- } else {
284- ui . addNotification ( null , E ( 'p' , _ ( 'Failed to restart mosdns: %s' ) . format ( res . output || 'Unknown error' ) ) ) ;
285- }
286- } )
287- . catch ( function ( e ) {
288- ui . addNotification ( null , E ( 'p' , _ ( 'Failed to restart mosdns: %s' ) . format ( e . message ) ) ) ;
289- } ) ;
271+ return this . handleSave ( ev ) . then ( function ( ) {
272+ window . location . reload ( ) ;
273+ } ) ;
290274 } ,
291275 handleReset : null
292276} ) ;
Original file line number Diff line number Diff line change @@ -822,10 +822,7 @@ start_service() {
822822 fi
823823 fi
824824
825- [ " $update_list " -eq 1 ] && {
826- sleep 3
827- $MOSDNS_SCRIPT update_adlist
828- } &
825+ [ " $update_list " -eq 1 ] && $MOSDNS_SCRIPT update_adlist &
829826}
830827
831828stop_service () {
Original file line number Diff line number Diff line change @@ -315,12 +315,10 @@ switch (action) {
315315 case "update" :
316316 update_geodat ();
317317 update_adlist ();
318- exec_sys ( '/etc/init.d/mosdns restart' );
318+ v2dat_dump ( );
319319 break ;
320320 case "update_adlist" :
321- if (update_adlist ()) {
322- exec_sys ('/etc/init.d/mosdns restart' );
323- }
321+ update_adlist ();
324322 break ;
325323 case "v2dat_dump" :
326324 v2dat_dump ();
Original file line number Diff line number Diff line change 1818 " clean_log" ,
1919 " flush_cache" ,
2020 " get_version" ,
21- " print_log" ,
22- " restart"
21+ " print_log"
2322 ]
2423 },
2524 "uci" : [ " mosdns" ]
Original file line number Diff line number Diff line change @@ -34,11 +34,6 @@ function exec_sys(cmd) {
3434 return { code: code, stdout: stdout || "" };
3535}
3636
37- function restart_mosdns() {
38- let p = popen('(sleep 1; /etc/init.d/mosdns restart) >/dev/null 2>&1 &', 'r');
39- if (p) p.close();
40- }
41-
4237function get_logfile_path_internal() {
4338 let uci_cursor = cursor();
4439 uci_cursor.load('mosdns');
@@ -124,13 +119,6 @@ const methods = {
124119 return { error: res.stdout };
125120 }
126121 }
127- },
128-
129- restart: {
130- call: function() {
131- restart_mosdns();
132- return { code: 0, output: "mosdns is restarting in background." };
133- }
134122 }
135123};
136124
You can’t perform that action at this time.
0 commit comments