Add proftpd as service

This commit is contained in:
Johannes Zellner
2019-03-18 19:02:32 -07:00
parent a435e88b25
commit cde852f0f9
5 changed files with 172 additions and 0 deletions

View File

@@ -211,6 +211,11 @@ const KNOWN_SERVICES = {
status: statusUnbound,
restart: restartUnbound,
defaultMemoryLimit: 0
},
proftpd: {
status: statusProftpd,
restart: restartProftpd,
defaultMemoryLimit: 0
}
};
@@ -1715,3 +1720,19 @@ function restartUnbound(callback) {
callback(null);
}
function statusProftpd(callback) {
assert.strictEqual(typeof callback, 'function');
shell.exec('statusProftpd', 'systemctl is-active proftpd', function (error) {
callback(null, { status: error ? exports.SERVICE_STATUS_STOPPED : exports.SERVICE_STATUS_ACTIVE });
});
}
function restartProftpd(callback) {
assert.strictEqual(typeof callback, 'function');
shell.sudo('restartProftpd', [ path.join(__dirname, 'scripts/restartproftpd.sh') ], {}, NOOP_CALLBACK);
callback(null);
}