Skip to content
This repository has been archived by the owner on Jan 16, 2019. It is now read-only.

Commit

Permalink
V0.3 Released
Browse files Browse the repository at this point in the history
  • Loading branch information
AmusingThrone committed May 22, 2017
1 parent 767f1bf commit 45df32e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# kitsune-auto-setup
An Automated Setup (one file) for new CPPS owners. Idea from Dev's [script](https://aureus.pw/topic/1172-kitsune-auto-setup-script-as2/). Uses Kitsune AS2 Protocol.
An Automated Setup (one file) for new CPPS owners. Idea from Dev's [script](https://aureus.pw/topic/1172-kitsune-auto-setup-script-as2/). Uses Kitsune AS2 or AS3 Protocol.


----------
Expand Down
23 changes: 13 additions & 10 deletions setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,38 @@ function sendMessage($message) {

}

$version = "v0.2 Alpha";
$version = "v0.3";

echo "\n";


sendMessage("Welcome to Kitsune Auto Installer " . $version);
sendMessage("Script Designed by AmusingThrone\n");

sendMessage("Would you like to install Kistune AS2 or AS3?");
$protocol = trim(fgets(STDIN));
$protocol = strtolower($protocol);

while ($protocol != "as2" or "as3") {
$types = array (
'as2',
'as3'
);

while (!in_array($protocol, $types)) {
sendMessage("You can only respond in AS2 or AS3");
sendMessage("Would you like to install Kistune AS2 or AS3?");
$protocol = trim(fgets(STDIN));
$protocol = strtolower($protocol);
}

sendMessage(strtoupper($protocol) . " protocol chosen.");

$url = "";

if ($protocol = "as2") {
if ($protocol = $types[1]) {

$url = "https://github.com/AmusingThrone/kitsune-auto-setup/raw/master/Kitsune.zip";

} elseif ($protocol = "as3") {
} elseif ($protocol = $types[2]) {

$url = "https://github.com/widd/kitsune/archive/master.zip";

Expand Down Expand Up @@ -145,7 +151,6 @@ function sendMessage($message) {
}

if (in_array($conan, $answers)) {
$conan = trim(fgets(STDIN));
$xml = new DOMDocument('1.0', 'utf-8');
$xml->formatOutput = true;
$xml->preserveWhiteSpace = false;
Expand All @@ -159,9 +164,8 @@ function sendMessage($message) {
$xml->save("kitsune/Database.xml");
sendMessage("Successfully updated your Database.xml file!\n");
} elseif (in_array($conan, $no)) {
$conan = trim(fgets(STDIN));
sendMessage("Shutting down Configuration Setup...");
die("Kitsune Setup finished! Enjoy!\n");
die("Kitsune " . strtoupper($protocol) . " Setup Finished! Enjoy!");
}

sendMessage("--------Database Setup--------");
Expand All @@ -171,9 +175,8 @@ function sendMessage($message) {
echo "\n";

if (in_array($answer, $no)) {
$conan = trim(fgets(STDIN));
sendMessage("Shutting down Database Setup...");
die("Kitsune Setup finished! Enjoy!\n");
die("Kitsune " . strtoupper($protocol) . " Setup Finished! Enjoy!");
}

$database = file_get_contents('kitsune/Kitsune.sql');
Expand Down

0 comments on commit 45df32e

Please sign in to comment.