Menu

yfi_setup_centos_cron

Anonymous

Cron Scripts - RHEL/CentOS

YFi Hotspot Manager requires a few scripts to run periodically in order to maintain a healthy and working system.
Most of the scripts are CakePHP shell scripts.
This makes it easy to interact with the MySQL database used by FreeRADIUS.

  • To enable/activate the CRON script, just copy the script from the "yfi_cake" directory

    cp /var/www/html/c2/yfi_cake/setup/cron/yfi /etc/cron.d/
    
  • We will also have to modify the CRON script by replacing the apache user and path to suite RHEL/CentOS

    cd /etc/cron.d
    sed 's|www-data|apache|g' yfi > yfi.tmp;mv yfi.tmp yfi;
    sed 's|/var/www/c2|/var/www/html/c2|g' yfi > yfi.tmp;mv yfi.tmp yfi;
    
  • For those of you new to sed, the "sed" lines above does the following:

    • It Searches for "www-data" and replaces it with "apache" string.

    • It then takes the output of the operation and writes it to a file "yfi.tmp".

    • And finally, it renames the file "yfi.tmp" with the corrected string (apache) to "yfi".

    • The same goes for the second line; Replaces "/var/www/c2" with "/var/www/html/c2", outputs the file to
      "yfi.tmp" and lastly renames the file "yfi.tmp" to "yfi". NOTE: As mentioned above, you must follow this steps in order to avoid problems later on with cron.

Congratulations! Your YFi Hotspot Manager setup is complete


Detail on scripts

Should you want to know what the function of each script is, the following page has more detail:
pptpd setup


Related

Wiki: Home
Wiki: yfi_setup_centos_pptpd
Wiki: yfi_setup_pptpd