DJM0 / unifi-voucher-generator

Generates UniFi Hotspot vouchers using the UniFi controller API ready for printing
The Unlicense
80 stars 26 forks source link

it's still working ? i can't create voucher with unifi controller version 5.6.30 ! can you help me ? pls #5

Closed hieunguyenps01 closed 6 years ago

DJM0 commented 6 years ago

I haven’t tested this in a few years. Do you get any errors when it fails?

But I will try and test it over the next few days if I can setup a controller.

hieunguyenps01 commented 6 years ago

It's working. controller version 5 that have a little change. syntax for $site not working. i must use string be generate from controller.

thanks for your support. your script are working.

Thanks you so much

2018-04-15 21:14 GMT+07:00 David Maitland notifications@github.com:

I haven’t tested this in a few years. Do you get any errors when it fails?

But I will try and test it over the next few days if I can setup a controller.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidmaitland/unifi-voucher-generator/issues/5#issuecomment-381409844, or mute the thread https://github.com/notifications/unsubscribe-auth/ALYUFvShUr-s-34kseu3vNcVlydhhigzks5to1XOgaJpZM4TVbf- .

DJM0 commented 6 years ago

Great! I have updated the repo to make it a bit clearer.

https://github.com/davidmaitland/unifi-voucher-generator/blob/a64bae31214d7b2c7bc7168153853e41d18b3371/unifi-api.sh#L7

hieunguyenps01 commented 6 years ago

Hi there.

I want rebuild your code for use generate multi site. Have you suggest something ?

DJM0 commented 6 years ago

You could easily modify unifi-api.sh and gen.sh to use environment variables instead of them being defined at the top of the files. Then you could create a simple bash loop to run the gen.sh script for every site in a list.

hieunguyenps01 commented 6 years ago

Hi david.

i have create a lot of file api.sh for many site.

i have create loop like that ! how to run api.sh follow varriables in loop ?