Skip to content

Commit

Permalink
added $configfile as global in config_save()
Browse files Browse the repository at this point in the history
  • Loading branch information
leongrdic committed Nov 25, 2019
1 parent 19c6ad3 commit 2313c0b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion update.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function echox($msg, $code = 0) { echo $msg . PHP_EOL; exit($code); }
if(!isset($config['api_url']) || empty($config['api_url'])) echox("missing/wrong api url, exiting", 3);
if(!isset($config['installed_keys'])) $config['installed_keys'] = [];
if(!isset($config['keys_file'])) $config['keys_file'] = 'authorized_keys';
function config_save(){ global $config; file_put_contents($configfile, json_encode($config)); }
function config_save(){ global $configfile, $config; file_put_contents($configfile, json_encode($config)); }

$keys = json_decode(@file_get_contents($config['api_url'], false, stream_context_create(['http' => $config['api_http_options']])), true);
if(strpos($http_response_header[0], '200') === false) echox("invalid response from api: ({$http_response_header[0]}); exiting", 4);
Expand Down

0 comments on commit 2313c0b

Please sign in to comment.