Skip to content

Commit

Permalink
Renamed orchid.sh to orchid
Browse files Browse the repository at this point in the history
  • Loading branch information
VentGrey committed Apr 14, 2020
1 parent 5eb2bdb commit 1ad3002
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions orcd
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#! /usr/bin/env bash


[ -L "$0" ] && pushd "$(readlink "$0" | xargs dirname)" > /dev/null \
|| pushd "$(dirname "$0")" > /dev/null || exit
OPATH=$(pwd -P)
export OPATH
popd > /dev/null || exit

function use {
cat << __EOF__
❀ O R C H I D ❀
Sysadmin script for common server tasks
usage: orcd [BREED] [OPTIONS] or type "--help" to view this screen
or command help usage.
OPTIONS:
help
BREEDS:
__EOF__

for i in "${OPATH}"/breeds/*; do
[ ! -L "$i" -a -f "$i" ] && echo " ${i##*/}"
done

[ "${OPTIONS}" == "help" ] && exit 0 || exit 1

}

OPTIONS=$1; shift;

[ ! -f "${OPATH}/breeds/${OPTIONS}" ] && use
"${OPATH}"/breeds/"${OPTIONS}" "$@"

# Orchid 2020 - VentGrey

0 comments on commit 1ad3002

Please sign in to comment.