Skip to content

Commit

Permalink
chore: add check condition to run password
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuscomh committed Feb 2, 2025
1 parent fbb5f36 commit 7020d87
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# shellPass - Shell Script Password Generator

[![Release](https://img.shields.io/badge/release-3.4.1-brightgreen)](https://github.com/mateuscomh/shellPass/releases)
[![Release](https://img.shields.io/badge/release-3.5.0-brightgreen)](https://github.com/mateuscomh/shellPass/releases)
[![Build Status](https://github.com/mateuscomh/shellPass/actions/workflows/super-linter.yml/badge.svg)](https://github.com/mateuscomh/shellPass/actions/workflows/super-linter.yml)

## Overview
Expand Down
38 changes: 18 additions & 20 deletions shellPass.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ BOLD=$(tput bold)
ITALIC=$(tput dim)

main() {
local VERSION="Ver:3.4.1"
local VERSION="Ver:3.5.0"
local AUTHOR="Matheus Martins-3mhenrique@gmail.com"
local USAGE="Generate random passwords from CLI
███████╗██╗ ██╗███████╗██╗ ██╗ ██████╗ █████╗ ▄▄███▄▄·▄▄███▄▄·
Expand Down Expand Up @@ -83,25 +83,23 @@ _writeinfile() {
}

_makePass() {
PASS=$(tr -dc "$CPX" </dev/urandom | head -c "$MAX")
case $(uname -s) in
Darwin) printf %s "$PASS" | pbcopy 2>/dev/null ;;
Linux)
if grep -iq Microsoft /proc/version; then
printf "%s" "$PASS" | clip.exe
elif command -v xclip >/dev/null; then
printf "%s" "$PASS" | xclip -sel clip
else
echo "$PASS"
exit 125
fi
;;
*)
echo "This is compatible only for GNU/Linux, MacOS or WSL2"
exit 1
;;
esac
echo -e "${BOLD}$PASS${FECHA}"
if PASS=$(tr -dc "$CPX" </dev/urandom | head -c "$MAX"); then
echo -e "${BOLD}$PASS${FECHA}"
case $(uname -s) in
Darwin) printf %s "$PASS" | pbcopy 2>/dev/null ;;
Linux)
if grep -iq Microsoft /proc/version; then
printf "%s" "$PASS" | clip.exe
elif command -v xclip >/dev/null; then
printf "%s" "$PASS" | xclip -sel clip
fi
;;
*)
echo "This is compatible only for GNU/Linux, MacOS or WSL2"
exit 1
;;
esac
fi
}
#---Main
main "$1" "$2"

0 comments on commit 7020d87

Please sign in to comment.