Giter Site home page Giter Site logo

lars-script-runner's Introduction

lars-script-runner

Tiny command line tool that will make sure a list of scripts or other commands are always running.

If one of the commands exits, with or without errors, this tool will make sure each command is restarted no more often than once per second.

The functionality can most likely be replicated with a small shell or powershell script, but I wanted to learn a bit more about Go and see if it was possible to do something lower level like this with no platform specific code at all.

Installation

go install github.com/lab1702/lars-script-runner@latest

Downloading source and running the example:

git clone https://github.com/lab1702/lars-script-runner.git
cd lars-script-runner
go build
./lars-script-runner

If all works, to install do:

go install

How to configure what commands to keep alive:

Edit the commands.txt file to contain all the commands you want to have running at all times, putting one command on each line.

To use a command list of a different name and/or location:

./lars-script-runner -f /path/to/commands.txt

Compatibility:

This was developed on Windows Server 2022 and Ubuntu 22.04 LTS and the example is tested to run as is as on Windows and on Linux if PowerShell is installed.

The commands.txt file can contain anything, so you can launch bash scripts, binaries etc.

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.