Code Monkey home page Code Monkey logo

hostfile_manager's Introduction

This is a simple Perl script for managing multiple hostfile configurations on *NIX systems.

To get started, create a directory /etc/hostfiles and place one or more files in the directory containing hostfile fragments.  The fragment filename will be used to tell the hostfile manager what to enable or disable.

Using the hostfile manager is simple.  It has two primary options: --enable and --disable.  You can specify each multiple times or pass comma-separated lists of fragment filenames.

For example, to enable a hostfile fragment called "staging":

$ hostfiles --enable staging

You can ask for the status of the available hostfile fragments by passing the --status flag:

$ hostfiles --status
+ local
$

The first character of the status ouput will be ' ' if the fragment is not enabled, '+' if it is enabled, and '*' if it is enabled and has been modified in /etc/hosts.

Passing the --interactive flag will ignore any --enable, --disable, or --status options and present a list of hostfile fragments that can be enabled or disabled interactively.

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.