Skip to content

marcmascort/bash-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BASH HELPERS

Installation

Composer

composer require marcmascort/bash-helpers

NPM

npm install mmb-bash-helpers

Functions

Usage is very simply, you only need import helpers file.

source path/to/helpers

Display

success <message>
warning <message>
error <message>
highlight <message>
text <message>
title <message>
yell <message>

Execution

try <command>
die <message>

Files

make_executable <path/to/fileOrFolder>
make_writable <path/to/fileOrFolder>
make_readable <path/to/fileOrFolder>
make_chmod <modes> <path/to/fileOrFolder>
make_mkdir <path/to/fileOrFolder>
make_mv <path/to/source/fileOrFolder> <path/to/target/fileOrFolder>
make_cp <path/to/source/fileOrFolder> <path/to/target/fileOrFolder>
make_rm <path/to/fileOrFolder>

Strings

str_replace <search> <replace> <subject>

Libraries

Certificate generator

lib/cert-generate <hostname> <folder> <openssl_config_file>

Docker machine port forwarder

lib/docker-machine-port-forwarder <port> [-h] [-s] [-f] [-e] [-hp]

Manage /etc/hosts

lib/manage-etc-hosts add <hostname> [<ip>]
lib/manage-etc-hosts remove <hostname> [<ip>]

Manage git

lib/manage-git clone <repository> <folder> [<branch>]
lib/manage-git submodule <arguments>