diff --git a/src/commands/cwg.ts b/src/commands/cwg.ts index bfc5e89..0d0d8a9 100644 --- a/src/commands/cwg.ts +++ b/src/commands/cwg.ts @@ -134,8 +134,10 @@ export default class CWG extends Command { }); } } - await fs.unlink(`/etc/nginx/sites-available/${domain.domain}`); - await fs.unlink(`/etc/nginx/sites-enabled/${domain.domain}`); + try { + await fs.unlink(`/etc/nginx/sites-available/${domain.domain}`); + await fs.unlink(`/etc/nginx/sites-enabled/${domain.domain}`); + } catch (e) { this.client.signale.error(e); } await this.client.db.Domain.deleteOne({ domain: domain.domain }); await this.client.util.exec('systemctl reload nginx'); edit.edit(`***${this.client.stores.emojis.success} Domain ${domain.domain} with port ${domain.port} has been successfully deleted.***`);