ROOTPLOIT
Server: Apache
System: Linux node6122.myfcloud.com 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64
User: bashacomputer (1004)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/local/bin/knex-migrator-rollback
#!/usr/bin/env node

const program = require('commander');
const utils = require('../lib/utils');

const logging = require('../logging');
let knexMigrator;

utils.getKnexMigrator({path: process.cwd()})
    .then(function (KnexMigrator) {
        program
            .option('--mgpath <path>')
            .option('--force')
            .option('--v <version>', 'The version to rollback to.')
            .parse(process.argv);

        try {
            knexMigrator = new KnexMigrator({knexMigratorFilePath: program.mgpath, executedFromShell: true});
        } catch (err) {
            logging.error(err);
            process.exit(1);
        }

        return knexMigrator.rollback({force: program.force, version: program.v})
            .then(function () {
                logging.info('Rollback was successful.');
            });
    })
    .catch(function (err) {
        logging.error(err.message);

        if (err.help) {
            logging.info(err.help);
        }

        process.exit(1);
    });