This commit is contained in:
Torsten 2024-06-06 17:58:01 +02:00
parent 9d21b47e28
commit d6e7b5e486

View file

@ -16,4 +16,22 @@ VServer self-discover IPV4 address:
```bash
root@ubuntu-2gb-nbg1-1:~# curl -s http://169.254.169.254/hetzner/v1/metadata|grep public-ipv4|awk -F ': ' '{print $2}'
167.235.131.137
```
```
```bash
curl -s http://169.254.169.254/hetzner/v1/metadata|grep public-ipv4|awk -F ': ' '{print $2}' > ip.txt
```
PHP: Receive & write ip as textfile
```php
<?php
$myfile = fopen("ip.txt", "w");
fwrite($myfile, $_GET['ip']);
fclose($myfile);
?>
```