Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions linode.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
$hostname = (string)$argv[3];
$ip = (string)$argv[4];

$API_TOKEN = $account;
$API_TOKEN = $pwd;

// check the hostname contains '.'
if (strpos($hostname, '.') === false) {
Expand All @@ -27,14 +27,14 @@

$hostname = explode('.', $hostname);
$arrayCount = count($hostname);
if ($arrayCount > 2) {
$subDomain = implode('.', array_slice($hostname, 0, $arrayCount-2));
$domain = implode('.', array_slice($hostname, $arrayCount-2, 2));
} else {
$subDomain = '@';
$domain = implode('.', $hostname);
if ($arrayCount < 2) {
echo 'badparam';
exit();
}

$subDomain = $hostname[0];
$domain = implode('.', array_slice($hostname, 1, $arrayCount-1));

$post = array(
'api_key'=>$account,
'api_action'=>'domain.list'
Expand Down