mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2024-06-01 21:36:36 +02:00
40 lines
833 B
Perl
Executable file
40 lines
833 B
Perl
Executable file
#!/usr/bin/perl
|
|
#
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
|
#
|
|
# sudo su www-data -c "./src/scripts/sigo_client.pl shareedms-fr01 get_bikes"
|
|
#
|
|
use vars qw($syshost);
|
|
|
|
BEGIN {
|
|
$syshost = $ARGV[0] || die 'syshost not defined';
|
|
}
|
|
|
|
use lib "/var/www/copri-bike/$syshost/src";
|
|
use strict;
|
|
use warnings;
|
|
use POSIX;
|
|
use CGI;
|
|
use Mod::APIsigoclient;
|
|
use Data::Dumper;
|
|
|
|
my $q = new CGI;
|
|
my $cf = new Config;
|
|
my $si = new APIsigoclient;
|
|
my $bw = new Basework;
|
|
my $lang = "de";
|
|
my $now_dt = strftime "%Y-%m-%d %H:%M:%S", localtime;
|
|
my %varenv = $cf->envonline();
|
|
|
|
my $todo = $ARGV[1];
|
|
|
|
|
|
if($todo eq "get_bikes"){
|
|
$q->param(-name=>'request',-value=>"bikes_available");
|
|
my $auth = { c_id => 0 };
|
|
my $return = $si->sigo_available($q,\%varenv,$auth);
|
|
print $0 . Dumper($return) . "\n";
|
|
}
|
|
|