Skip to content

stevommmm/do

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published