readme update - added notes and cron info

This commit is contained in:
Shihaam Abdul Rahman 2022-06-07 01:08:00 +05:00
parent 1fd15e5880
commit 0a9b7e65f7
Signed by: shihaam
GPG Key ID: 16ADCF6871CB2A56

View File

@ -3,7 +3,7 @@
### Requirements ### Requirements
`dig` `dig` \
dig is most likely installed on your distro but incase it isn't install it first dig is most likely installed on your distro but incase it isn't install it first
### Usage ### Usage
@ -23,4 +23,16 @@ Make sure your nginx config server block contain "#DYNAMIC" after the IP you wan
Excute the script as root (or with sudo) with 1st arugement for config file and 2nd arugemt with domain of the IP you want to allow \ Excute the script as root (or with sudo) with 1st arugement for config file and 2nd arugemt with domain of the IP you want to allow \
`sudo ./nginx-allow-dynamicip.sh db-sarlinode.shihaam.dev home.shihaam.me` `sudo ./nginx-allow-dynamicip.sh db-sarlinode.shihaam.dev home.shihaam.me`
### Automate with cron
Run `crontab -e` as root as this script needs sudo.
```bash
sudo crontab -e`
```
I have it configured to update once every hour like this
```bash
0 * * * * /home/shihaam/scripts/nginx-allow-dynamicip.sh freezer.shihaam.me home.shihaam.me
```
### Notes
It is important that your nginx config files are in `/etc/nginx/sites-available/` and symlinked to `/etc/nginx/sites-enabled/`,\
This is done by default on Debian and Ubuntu,I noticed this is not how it's configured by default on Arch Linux and CentOS, If you're using those you have bigger issues.