luci-mod-system: reload crond upon saving crontab
Fixes: #5184 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
7d9ab8d4a7
commit
8d4ac60f7a
2 changed files with 5 additions and 4 deletions
|
@ -16,6 +16,8 @@ return view.extend({
|
||||||
return fs.write('/etc/crontabs/root', value).then(function(rc) {
|
return fs.write('/etc/crontabs/root', value).then(function(rc) {
|
||||||
document.querySelector('textarea').value = value;
|
document.querySelector('textarea').value = value;
|
||||||
ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
|
ui.addNotification(null, E('p', _('Contents have been saved.')), 'info');
|
||||||
|
|
||||||
|
return fs.exec('/etc/init.d/cron', [ 'reload' ]);
|
||||||
}).catch(function(e) {
|
}).catch(function(e) {
|
||||||
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
|
ui.addNotification(null, E('p', _('Unable to save contents: %s').format(e.message)));
|
||||||
});
|
});
|
||||||
|
@ -24,9 +26,7 @@ return view.extend({
|
||||||
render: function(crontab) {
|
render: function(crontab) {
|
||||||
return E([
|
return E([
|
||||||
E('h2', _('Scheduled Tasks')),
|
E('h2', _('Scheduled Tasks')),
|
||||||
E('p', { 'class': 'cbi-section-descr' },
|
E('p', { 'class': 'cbi-section-descr' }, _('This is the system crontab in which scheduled tasks can be defined.')),
|
||||||
_('This is the system crontab in which scheduled tasks can be defined.') +
|
|
||||||
_('<br/>Note: you need to manually restart the cron service if the crontab file was empty before editing.')),
|
|
||||||
E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10, 'disabled': isReadonlyView }, [ crontab != null ? crontab : '' ]))
|
E('p', {}, E('textarea', { 'style': 'width:100%', 'rows': 10, 'disabled': isReadonlyView }, [ crontab != null ? crontab : '' ]))
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
|
|
|
@ -72,7 +72,8 @@
|
||||||
},
|
},
|
||||||
"write": {
|
"write": {
|
||||||
"file": {
|
"file": {
|
||||||
"/etc/crontabs/root": [ "write" ]
|
"/etc/crontabs/root": [ "write" ],
|
||||||
|
"/etc/init.d/cron reload": [ "exec" ]
|
||||||
},
|
},
|
||||||
"ubus": {
|
"ubus": {
|
||||||
"file": [ "write" ]
|
"file": [ "write" ]
|
||||||
|
|
Loading…
Reference in a new issue