nonstop

run a command and start it again when it finishes
git clone https://noulin.net/git/nonstop.git
Log | Files | Refs | LICENSE

commit db4f29c382d483c8da60d8f8ad82f3fd221fcff7
parent 28fa5fb913fe3701f101ed50f8b9b2fe272b314b
Author: Remy Noulin <loader2x@gmail.com>
Date:   Sun, 20 May 2018 10:17:28 +0200

nonstop command

nonstop.c   | 27 +++++++++++++++++++++++++++
package.yml | 31 +++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+)

Diffstat:
Anonstop.c | 27+++++++++++++++++++++++++++
Apackage.yml | 31+++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 0 deletions(-)

diff --git a/nonstop.c b/nonstop.c @@ -0,0 +1,27 @@ +#! /usr/bin/env sheepy +/* or direct path to sheepy: #! /usr/local/bin/sheepy */ + +#include "libsheepyObject.h" + +int argc; char **argv; + +int main(int ARGC, char** ARGV) { + + argc = ARGC; argv = ARGV; + + initLibsheepy(argv[0]); + setLogMode(LOG_VERBOSE); + + if (argc < 2) { + puts(BLD RED "Command argument missing" RST); + XFAILURE; + } + + forever { + logI(BLD GRN "------- NONSTOP START ------------" RST); + system(argv[1]); + logI(BLD YLW "------- NONSTOP COMMAND END ------" RST); + logI("sleeping 5s - press ctrl-c to exit"); + sleep(5); + } +} diff --git a/package.yml b/package.yml @@ -0,0 +1,31 @@ +--- + name: nonstop + version: 0.0.1 + description: "run a command and start it again when it finishes" + bin: ./nonstop.c + #cflags: -DA -ggdb -std=gnu11 -fPIC -pipe + #lflags: -lpcre + repository: + type: git + url: git+https://github.com/RemyNoulin/nonstop.git + keywords: + - utility + - command + author: Anonymous + license: MIT + bugs: + url: https://github.com/RemyNoulin/nonstop/issues + homepage: https://github.com/RemyNoulin/nonstop + #compileHelp: # text displayed when there is a compilation error + #dependencies: + # md4c: + # Test configuration: + #testBin: ./testNonstop.c + #testCflags: -ggdb -std=gnu11 -fPIC -pipe -fprofile-arcs -ftest-coverage -Wall -Wextra + #testLflags: -lcheck_pic -lrt -lm -lsubunit -fprofile-arcs -ftest-coverage -rdynamic + # Memcheck configuration: + #memcheckBin: ./memcheckNonstop.c + #memcheckCmd: valgrind --leak-check=full --show-leak-kinds=all + #memcheckCflags: -ggdb -std=gnu11 -fPIC -pipe + #memcheckLflags: -rdynamic + #documentationCmd: # command for generating the documentation with spm doc