Ejemplo n.º 1
0
 public static function CreateSymlinksToUtils()
 {
     echo "* Creating /usr/bin symlinks" . PHP_EOL;
     AirtimeInstall::RemoveSymlinks();
     echo "* Installing airtime-import" . PHP_EOL;
     $dir = AirtimeInstall::CONF_DIR_BINARIES . "/utils/airtime-import/airtime-import";
     exec("ln -s {$dir} /usr/bin/airtime-import");
     echo "* Installing airtime-update-db-settings" . PHP_EOL;
     $dir = AirtimeInstall::CONF_DIR_BINARIES . "/utils/airtime-update-db-settings";
     exec("ln -s {$dir} /usr/bin/airtime-update-db-settings");
     echo "* Installing airtime-check-system" . PHP_EOL;
     $dir = AirtimeInstall::CONF_DIR_BINARIES . "/utils/airtime-check-system";
     exec("ln -s {$dir} /usr/bin/airtime-check-system");
     echo "* Installing airtime-user" . PHP_EOL;
     $dir = AirtimeInstall::CONF_DIR_BINARIES . "/utils/airtime-user";
     exec("ln -s {$dir} /usr/bin/airtime-user");
     echo "* Installing airtime-log" . PHP_EOL;
     $dir = AirtimeInstall::CONF_DIR_BINARIES . "/utils/airtime-log";
     exec("ln -s {$dir} /usr/bin/airtime-log");
 }
Ejemplo n.º 2
0
            $rows = array();
        }
        foreach ($rows as $row) {
            $tablename = $row["tablename"];
            echo "   * Removing database table {$tablename}...";
            if (AirtimeInstall::DbTableExists($tablename)) {
                $sql = "DROP TABLE {$tablename} CASCADE";
                AirtimeInstall::InstallQuery($sql, false);
                $CC_DBC->dropSequence($tablename . "_id");
            }
            echo "done." . PHP_EOL;
        }
    }
}
//------------------------------------------------------------------------
// Delete the user
//------------------------------------------------------------------------
echo " * Deleting database user '{$CC_CONFIG['dsn']['username']}'..." . PHP_EOL;
$command = "echo \"DROP USER IF EXISTS {$CC_CONFIG['dsn']['username']}\" | su postgres -c psql >/dev/null 2>&1";
@exec($command, $output, $results);
if ($results == 0) {
    echo "   * User '{$CC_CONFIG['dsn']['username']}' deleted." . PHP_EOL;
} else {
    echo "   * Nothing to delete." . PHP_EOL;
}
AirtimeInstall::RemoveSymlinks();
AirtimeInstall::UninstallBinaries();
AirtimeInstall::RemoveLogDirectories();
AirtimeIni::RemoveMonitFile();
@unlink('/etc/cron.d/airtime-crons');
/* FINISHED AIRTIME PHP UNINSTALLER */