Coder Social home page Coder Social logo

do's Introduction

do

Get things done.

Experiment in programming a programming language without all the features of other tools.

Think of the script files as dumb sequential if statements.

KEYWORD USAGE
SYNC <url> Use libcurl to fetch a remote script & exec
IF <cmd> ... A command with a zero exit code
NOT Negates the previous IF to a non-zero exit code
DO <cmd> ... A command to execute, optionally if the above [N]IF met the criteria
SET %VAR% <str> Create a variable to the contents of the next node, all later occurances are replaced.
NRDP <nagios> <token> <service> <hostname> <state:int> <output> Send passive data via Nagios Remote Data Processor.

todo

  • handle superfluous indenting characters
  • parse nested indenting
  • fetch remote scripts
  • variables / facts
  • parse nagios state OK|WARN|CRIT to ints for NRDP
  • global prefil %FQDN% variable

Example usage:

SET %MODES% "RELATED,ESTABLISHED"

DO echo "beginning!"

IF NOT rpm -q iptables
    DO yum install iptables -y

IF NOT iptables -C INPUT -m state --state %MODES% -j ACCEPT
    DO iptables -A INPUT -m state --state %MODES% -j ACCEPT

IF NOT iptables -C INPUT -i lo -j ACCEPT
    DO iptables -A INPUT -i lo -j ACCEPT

SYNC http://localhost/test.do

echo -e 'IF true\n\tDO echo it must be so!' > test.do
make
./do-run ./test.do

Building

ubuntu:

apt install -y make gcc libcurl4-openssl-dev --no-install-recommends
make

centos:

yum install -y make gcc libcurl-devel
make

arm (from x86):

docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -ti -v $(pwd):/mnt arm64v8/centos /bin/bash
# follow centos build process

do's People

Contributors

stevommmm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.