issue#2 clear tmp dir
This commit is contained in:
parent
72b4fec29e
commit
cb44b27bdc
@ -67,7 +67,6 @@ export default async bot => {
|
|||||||
case "cache":
|
case "cache":
|
||||||
cfg.websrv.cache = !cfg.websrv.cache;
|
cfg.websrv.cache = !cfg.websrv.cache;
|
||||||
return e.reply(`Cache is ${cfg.websrv.cache ? "enabled" : "disabled"}`);
|
return e.reply(`Cache is ${cfg.websrv.cache ? "enabled" : "disabled"}`);
|
||||||
break;
|
|
||||||
case "uptime":
|
case "uptime":
|
||||||
exec('sudo systemctl status f0ck', (err, stdout) => {
|
exec('sudo systemctl status f0ck', (err, stdout) => {
|
||||||
if(!err)
|
if(!err)
|
||||||
@ -82,10 +81,17 @@ export default async bot => {
|
|||||||
const tags = await cleanTags();
|
const tags = await cleanTags();
|
||||||
e.reply(tags + " tags removed");
|
e.reply(tags + " tags removed");
|
||||||
break;
|
break;
|
||||||
|
case "clearTmp":
|
||||||
|
await Promise.all((await fs.readdir("./tmp")).filter(d => d !== ".empty").map(async d => fs.unlink(`./tmp/${d}`)));
|
||||||
|
e.reply("cleared lol");
|
||||||
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
const tmpc = await countf0cks();
|
const tmpc = await countf0cks();
|
||||||
e.reply(`tagged: ${tmpc.tagged}; untagged: ${tmpc.untagged}; sfw: ${tmpc.sfw}; nsfw: ${tmpc.nsfw}; total: ${tmpc.total}`);
|
e.reply(`tagged: ${tmpc.tagged}; untagged: ${tmpc.untagged}; sfw: ${tmpc.sfw}; nsfw: ${tmpc.nsfw}; total: ${tmpc.total}`);
|
||||||
break;
|
break;
|
||||||
|
case "help":
|
||||||
|
e.reply("cmds: stats, limit, thumb, cache, uptime, restart, cleanTags, clearTmp, status");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user