From 2c2f8a1804798ca892e6f13ea9aabc338fa15848 Mon Sep 17 00:00:00 2001 From: Florent Date: Mon, 3 Sep 2012 12:51:55 +0200 Subject: [PATCH] if $phone is not set, take the first account available --- contrib/freemobile-munin | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/contrib/freemobile-munin b/contrib/freemobile-munin index a291ab8f..1ab091ea 100755 --- a/contrib/freemobile-munin +++ b/contrib/freemobile-munin @@ -56,9 +56,15 @@ my $cachedir = $ENV{'HOME'} . '/.config/weboob/munin/'; my $cachefile = "$cachedir/freemobile-munin"; my $refreshtime = $ENV{'cache_expire'} || 10_800; -my $phone = $ENV{'phonenumber'}; -my $weboob = '/usr/bin/env weboob-cli -b freemobile ICapBill get_details ' . $phone . '@freemobile -f table'; +my $phone = $ENV{'phonenumber'}; +my $account = ''; + +if (length($phone) > 0) { + $account = $phone . '@freemobile'; +} + +my $weboob = 'boobill -f table -b freemobile details ' . $account; my $cache_fh; my %label = (