..
This commit is contained in:
parent
9d21b47e28
commit
d6e7b5e486
1 changed files with 19 additions and 1 deletions
|
|
@ -16,4 +16,22 @@ VServer self-discover IPV4 address:
|
||||||
```bash
|
```bash
|
||||||
root@ubuntu-2gb-nbg1-1:~# curl -s http://169.254.169.254/hetzner/v1/metadata|grep public-ipv4|awk -F ': ' '{print $2}'
|
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
|
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);
|
||||||
|
|
||||||
|
?>
|
||||||
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue