wireless fine tuning

This commit is contained in:
bergware
2025-02-12 03:50:42 +01:00
parent 300bd2d468
commit 76f0d68f24
2 changed files with 9 additions and 12 deletions

View File

@@ -16,6 +16,13 @@ $ssl_input = '/etc/rc.d/rc.ssl.input';
if (is_readable($ssl_input)) extract(parse_ini_file($ssl_input));
switch ($argv[1]) {
case 'reload':
if (file_exists($ssl_input)) break;
case 'load':
$key = exec("dmidecode -qt1 | grep -Pom1 'Manufacturer: \K.+' | sed 's/ /_/g'")."ABCDEFGH";
$iv = "12".exec("cat /sys/class/net/wlan0/address | sed 's/://g'")."34";
file_put_contents($ssl_input, "cipher=aes-256-cbc\nkey=".substr($key,0,63)."\niv=$iv\n");
break;
case 'encrypt':
if (!empty($argv[2]) && isset($cipher,$key,$iv)) $encrypt = openssl_encrypt($argv[2],$cipher,$key,0,$iv);
if (!empty($encrypt)) echo "$encrypt";