#!/usr/local/php7.3/bin/php
<?php
`cp config.php config.php2`;
//$username = `grep users_json config.php | awk '{print $3}' | sed 's/[:\"{]//g'`;
//$password = `grep users_json config.php | awk '{print $4}' | sed 's/[:\"{};]//g'`;
$config = `sed -i 's/\\\\"/"/g' config.php`;
require('config.php');
$config = `sed -i '/users_json/d' config.php`;
//$username = trim($username);
//$password = trim($password);
$users_json = json_decode($users_json, true);
foreach ($users_json as $k => $v) {
$users_json[$k] = password_hash($v, PASSWORD_DEFAULT);
}
//$password = password_hash($password, PASSWORD_DEFAULT);
$credentials = json_encode($users_json, true);
file_put_contents('config.php', '$users_json = \'' . $credentials . '\';' . "\n", FILE_APPEND);