if (!hasTable('mod_xtreamautoscript')) {
WHMCS\Database\Capsule::schema()->create('mod_xtreamautoscript', function($table) {
$table->string('name');
$table->string('value');
});
$autoscript = array('Enigma 2 OE 1.6' => 'wget -O /etc/enigma2/iptv.sh \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_ password}&type=enigma216_script&output={$outputfir st}\' && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh', 'Enigma 2 OE 2.0' => 'wget -O /etc/enigma2/iptv.sh \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_ password}&type=enigma22_script&output={$outputfirs t}\' && chmod 777 /etc/enigma2/iptv.sh && /etc/enigma2/iptv.sh', 'Octagon Script' => 'wget -qO /var/bin/iptv \'{$serverhostname}/get.php?username={$iptv_username}&password={$iptv_ password}&type=octagon_script&output={$outputfirst }\'');
foreach ($autoscript as $name => $value) {
$configurationautoscript[] = array('name' => $name, 'value' => $value);
}
WHMCS\Database\Capsule::table('mod_xtreamautoscrip t')->delete();
try {
WHMCS\Database\Capsule::table('mod_xtreamautoscrip t')->insert($configurationautoscript);
}
catch (Exception $e) {
return array('status' => 'error', 'description' => $e->getMessage() . '. There is an error while activating this module');
}
}
else {
return array('status' => 'error', 'description' => $e->getMessage() . '. There is an error while activating this module');
}