Skip to content

Commit

Permalink
Bugfixes & Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
schlomo committed Oct 7, 2018
1 parent 83bce8d commit fd9abeb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif
git push

release: commit-release deb
@latest_tag=$$(git describe --tags `git rev-list --tags --max-count=1`); \
@latest_tag=$$(git describe --tags `git rev-list --tags --max-count=1 2>/dev/null` 2>/dev/null); \
comparison="$$latest_tag..HEAD"; \
if [ -z "$$latest_tag" ]; then comparison=""; fi; \
changelog=$$(git log $$comparison --oneline --no-merges --reverse); \
Expand Down
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Retrieve internet tickets from Fritzbox and print on a Zebra printer
====================================================================

The [AVM FRITZ!Box](https://avm.de/produkte/fritzbox/) (FB) routers have a feature to allow Internet access to specific devices only for a certain amount of time. If that time is exceeded then the owner can print [Internet Tickets](https://en.avm.de/service/fritzbox/fritzbox-7490/knowledge-base/publication/show/3408_Extending-the-online-time-permitted-in-the-parental-controls-with-tickets/) that allow another 45 minutes of surfing.

The code in this repo helps to automate the retrieval and distribution of such Internet tickets.

Retrieving Tickets
------------------

The `fritzbox-get-internet-tickets.py` program will connect to the FB, retrieve the 10 available Internet tickets via web scraping (there is no API for that) and print them as a list to STDOUT.

Set the password via the `FRITZBOX_PASSWORD` environment variable and check the code for more options.

This program is usually not used directly, unless you plan to distribute the tickets yourself.

Printing Tickets
----------------

The `fritzbox-internet-ticket` program is the main program and will first retrieve the tickets from the FB and then send the first ticket to a print queue. This program also has a Desktop starter called "Print Internet Ticket".

Optionally it will upload the remaining 9 Internet tickets to a Google form for further processing. To enable this feature set the `FRITZBOX_GOOGLE_FORM_ID` and `FRITZBOX_GOOGLE_FORM_ENTRY_ID` variables to suitable values (get the values from a prefilled link to your form. The form should simply contain one text entry field).

Configuration
-------------

All configuration parameters are stored in `/etc/fritzbox-internet-ticket.conf` like this:
```bash
FRITZBOX_PASSWORD=mySuperSecretPasswort
FRITZBOX_PRINT_QUEUE=Zebra
FRITZBOX_GOOGLE_FORM_ID=1FAIpQLSfhbfiefhb437ghffsUW-WULIAkPL_J-RtJN_Kiu4Fhjdwshgw
FRITZBOX_GOOGLE_FORM_ENTRY_ID=1598434206
```

Take care to protect this file with file system permissions if you are on a multi user system.
2 changes: 2 additions & 0 deletions fritzbox-internet-ticket
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

test -r /etc/fritzbox-internet-ticket.conf && source /etc/fritzbox-internet-ticket.conf

export ${!FRITZBOX_*}

tickets=( $(fritzbox-get-internet-tickets.py) )

if test "$FRITZBOX_PRINT_QUEUE" ; then
Expand Down

0 comments on commit fd9abeb

Please sign in to comment.