summaryrefslogtreecommitdiff
path: root/doc/samples/lsmb01-cli-example.sh
blob: 1a95dc8a1ffd9e0a868b22d5211abb514f070acd (plain)
  1. #!/bin/bash
  2. #######################################################################
  3. #
  4. # lsmb01-cli-example.sh
  5. # Copyright (C) 2006. Louis B. Moore
  6. #
  7. # $Id: $
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; either version 2 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This program is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22. #######################################################################
  23. NOW=`pwd`
  24. echo -n "Ledger-SMB login: "
  25. read LSLOGIN
  26. echo
  27. echo -n "Ledger-SMB password: "
  28. stty -echo
  29. read LSPWD
  30. stty echo
  31. echo
  32. ARG="login=${LSLOGIN}&password=${LSPWD}&path=bin&action=search&db=customer"
  33. LGIN="login=${LSLOGIN}&password=${LSPWD}&path=bin&action=login"
  34. LGOT="login=${LSLOGIN}&password=${LSPWD}&path=bin&action=logout"
  35. cd /usr/local/ledger-smb
  36. ./login.pl $LGIN 2>&1 > /dev/null
  37. ./ct.pl $ARG
  38. ./login.pl $LGOT 2>&1 > /dev/null
  39. cd $NOW
  40. exit 0