버전 비교

  • 이 줄이 추가되었습니다.
  • 이 줄이 삭제되었습니다.
  • 서식이 변경되었습니다.

목차

Install HTTPD

코드 블럭
languagebash
themeEmacs
linenumberstrue
sudo yum -y install httpd

Create index.html

코드 블럭
languagebash
themeEmacs
linenumberstrue
sudo touch /var/www/html/index.html
sudo chown kreonet:kreonet /var/www/html/index.html

Upload Script

Upload list_dhcp_clients.py on /home/kreonet/list_dhcp_clients.py

Change permission

코드 블럭
languagebash
themeEmacs
chmod 755 /home/kreonet/list_dhcp_clients.py

Modify Script (if needed)

Check that /bin/python3 and other files are exists

코드 블럭
languagepy
themeEmacs
titlelist_dhcp_clients.py
linenumberstrue
#!/bin/python3
...
HOSTS='/etc/dnsmasq.d/bmc-hosts.conf'
LEASES='/var/lib/dnsmasq/bmc.leases'
ISO_DIR='/ISOs'
OUT='/var/www/html/index.html'
...

Register script via crontab

코드 블럭
languagebash
themeEmacs
crontab -e

# add the following
*/5 * * * * /home/kreonet/list_dhcp_clients.py

Access to webpage