zz_deprecated:bash:common_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Last revisionBoth sides next revision | ||
linux:bash:common_functions [2022/11/16 08:16] – dodger | zz_deprecated:bash:common_functions [2022/11/16 08:18] – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Useful bash functions ====== | ||
- | |||
- | |||
- | <WRAP center round info 60%> | ||
- | **DEPRECATED, | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | ===== ssh_it ===== | ||
- | |||
- | <code bash> | ||
- | # CONFIG SECTION | ||
- | SSHIT=" | ||
- | |||
- | # FUNCTION SECTION | ||
- | ssh_it() | ||
- | { | ||
- | ${SSHIT} $* 2>/ | ||
- | } | ||
- | </ | ||
- | |||
- | ===== debug_me ===== | ||
- | <code bash> | ||
- | debug_me() | ||
- | { | ||
- | if [[ ${DEBUG} -eq 0 ]] ; then | ||
- | echo -e " | ||
- | fi | ||
- | } | ||
- | </ | ||
- | |||
- | Dependencies: | ||
- | * [[# | ||
- | |||
- | ===== check_vm ===== | ||
- | For nutanix: | ||
- | |||
- | <code bash> | ||
- | check_vm() | ||
- | { | ||
- | local THEVM=" | ||
- | if [[ $(ssh_it " | ||
- | debug_me " | ||
- | #echo -e " | ||
- | return 0 | ||
- | else | ||
- | debug_me " | ||
- | #echo -e " | ||
- | return 1 | ||
- | fi | ||
- | } | ||
- | |||
- | # calling it | ||
- | check_vm " | ||
- | RES=$? | ||
- | </ | ||
- | |||
- | Dependency: | ||
- | * [[#ssh_it]] | ||
- | * [[# | ||
- | * '' | ||
- | |||
- | |||
- | |||
- | |||
- | ====== bash_colors ====== | ||
- | |||
- | <code bash> | ||
- | LIGHTGREEN=" | ||
- | LIGHTRED=" | ||
- | LIGHTBLUE=" | ||
- | WHITE=" | ||
- | RESET=" | ||
- | </ | ||
- | |||
- | |||
zz_deprecated/bash/common_functions.txt · Last modified: 2022/11/16 08:18 by dodger