Skip to content

Commit

Permalink
Merge pull request #33 from antwal/master
Browse files Browse the repository at this point in the history
General changes from antwal
  • Loading branch information
haakonnessjoen committed Jul 10, 2017
2 parents a40c7ef + 9c8a066 commit 22a8681
Show file tree
Hide file tree
Showing 5 changed files with 210 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
/install-sh
/missing
/src/stamp-h1
.DS_Store
54 changes: 54 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
language: c

sudo: required

matrix:
include:
- os: linux
dist: trusty
env: OSNAME="linux"
- os: osx
osx_image: xcode9
env: OSNAME="osx" OSVERSION="10.13" OSBUILD="brew"
- os: osx
osx_image: xcode8.3
env: OSNAME="osx" OSVERSION="10.12" OSBUILD="brew"
- os: osx
osx_image: xcode8
env: OSNAME="osx" OSVERSION="10.11" OSBUILD="brew"
- os: osx
osx_image: xcode6.4
env: OSNAME="osx" OSVERSION="10.10 10.9" OSBUILD="sources"

compiler: gcc

notifications:
email:
on_success: never
on_failure: change

branches:
only:
- master

addons:
apt:
packages:
- automake
- autoconf
- libtool
- m4
- gettext

before_install:
- chmod a+x ./travis-before_install.sh
- ./travis-before_install.sh

script:
- ./autogen.sh
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./configure --disable-nls; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./configure; fi
- make all

after_script:
- set +e
79 changes: 66 additions & 13 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
MAC-Telnet for Posix systems
============================
[![Build Status](https://travis-ci.org/antwal/MAC-Telnet.svg?branch=master)](https://travis-ci.org/antwal/MAC-Telnet)

Console tools for connecting to, and serving, devices using MikroTik RouterOS MAC-Telnet protocol.

Expand Down Expand Up @@ -32,25 +33,77 @@ Install dependencies, download source tarball, extract, compile and install:
wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz
tar zxvf mactelnet.tar.gz
cd haakonness*/

# Install dependencies
brew install gettext

# Check what paths it tells you to use, for a standard install, the following should suffice:
export PATH=/usr/local/opt/gettext/bin:$PATH

./autogen.sh
./configure
./configure --disable-nls
make all install

And you are ready..

### Mac OS X (without Homebrew) ###

Install dependencies, download source tarball, extract, compile and install:

export build=~/devtools # or wherever you'd like to build
mkdir -p $build

cd $build
wget https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xzf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr/local
make
sudo make install
export PATH=$PATH:/usr/local/bin

cd $build
wget https://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
tar xzf automake-1.15.tar.gz
cd automake-1.15
./configure --prefix=/usr/local
make
sudo make install

cd $build
wget https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
tar xzf libtool-2.4.6.tar.gz
cd libtool-2.4.6
./configure --prefix=/usr/local
make
sudo make install

cd $build
wget https://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.gz
tar zxf gettext-0.19.8.1.tar.gz
cd gettext-0.19.8.1
./configure --prefix=/usr/local
make
sudo make install

cd $build
wget http://github.com/haakonnessjoen/MAC-Telnet/tarball/master -O mactelnet.tar.gz
tar zxf mactelnet.tar.gz
cd haakonness*/
./autogen.sh
./configure --disable-nls
make all
sudo make install

And you are ready.


Usage
-----

# mactelnet -h
Usage: mactelnet <MAC|identity> [-h] [-n] [-a <path>] [-A] [-t <timeout>] [-u <user>] [-p <password>] [-U <user>] | -l [-B] [-t <timeout>]

Parameters:
MAC MAC-Address of the RouterOS/mactelnetd device. Use mndp to
discover it.
Expand Down Expand Up @@ -81,20 +134,20 @@ Example using identity:
Example using mac address:

$ mactelnet 0:c:42:43:58:a5 -u admin
Password:
Password:
Connecting to 0:c:42:43:58:a5...done


MMM MMM KKK TTTTTTTTTTT KKK
MMMM MMMM KKK TTTTTTTTTTT KKK
MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK
MMM MM MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK
MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK
MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK

MikroTik RouterOS 4.0 (c) 1999-2009 http://www.mikrotik.com/


[admin@HMG] >

### Tips
Expand All @@ -110,7 +163,7 @@ MAC-Ping usage

# macping -h
Usage: macping <MAC> [-h] [-c <count>] [-s <packet size>]

Parameters:
MAC MAC-Address of the RouterOS/mactelnetd device.
-s Specify size of ping packet.
Expand All @@ -125,7 +178,7 @@ Example:
0:c:42:43:58:a5 56 byte, ping time 1.20 ms
0:c:42:43:58:a5 56 byte, ping time 0.65 ms
0:c:42:43:58:a5 56 byte, ping time 1.19 ms

5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.65/1.06/1.20 ms

Expand Down
1 change: 1 addition & 0 deletions m4/.place_holder
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
m4: add folder for travis build
88 changes: 88 additions & 0 deletions travis-before_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/bin/bash

set -e

if [[ $TRAVIS_OS_NAME == 'linux' ]]; then

sudo apt-get update
sudo apt-get install -y gettext autopoint

fi


if [[ $TRAVIS_OS_NAME == 'osx' ]]; then

case "${OSBUILD}" in
brew)
# Install some custom requirements on OS X from brew
# Force update homebrew
cd "$(brew --repo)"
git fetch
git reset --hard origin/master
brew update
# Try install gettext
brew install gettext
brew link --force gettext
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
# Check what paths it tells you to use, for a standard install, the following should suffice:
export PATH="/usr/local/opt/gettext/bin:$PATH"
cd ~/
;;
sources)
# Install some custom requirements on OS X from sources
export build=~/devtools
mkdir -p $build
##
# Autoconf
##
cd $build
echo "Build autoconf..." >&2
curl -OL https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
tar xzf autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=/usr/local
make
sudo make install
export PATH=$PATH:/usr/local/bin
##
# Automake
##
cd $build
echo "Build automake..." >&2
curl -OL https://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
tar xzf automake-1.15.tar.gz
cd automake-1.15
./configure --prefix=/usr/local
make
sudo make install
##
# Libtool
##
cd $build
echo "Build libtool..." >&2
curl -OL https://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
tar xzf libtool-2.4.6.tar.gz
cd libtool-2.4.6
./configure --prefix=/usr/local
make
sudo make install
##
# GetText
#
cd $build
echo "Build gettext..." >&2
curl -OL https://ftp.gnu.org/gnu/gettext/gettext-0.19.8.1.tar.gz
tar zxf gettext-0.19.8.1.tar.gz
cd gettext-0.19.8.1
./configure --prefix=/usr/local
make
sudo make install
##
# Installation Complete
##
echo "Installation Complete." >&2
cd ~/
;;
esac

fi

0 comments on commit 22a8681

Please sign in to comment.