sipcapture / homer-api

HOMER 5: Back-End (API) DEPRICATED - use sipcapture/homer-app
http://sipcapture.org
27 stars 67 forks source link

[bugfix] New rotation script: fixes paths / arguments for rotation.ini #82

Closed dougbtv closed 8 years ago

dougbtv commented 8 years ago

When running scripts/new/homer_mysql_rotate.pl it wasn't picking up the argument for the ini location, the argv array element referenced was just off, so I changed from 1 to 0.

Also, I had it figure out the dir it's working from and use that as a default, but...

Additionally, when running from cron without the argument, it was looking for rotation.ini locally, but it didn't have working dir context, so it would fail to load it. So I added a little logic to have it figure out what dir the script is working in and reference the absolute path. I just used bashes dirname for the special $0 value in perl. I think that Perl had a Cwd module which will figure out the absolute path, but, my perl is a tiny bit rusty. Feel free to update that if you're more of a perl guru than I.

adubovikov commented 8 years ago

thanks!

dougbtv commented 8 years ago

No prob, thanks for the merge Alexandr!