You've already forked personal-linux-config
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
bcaffe612c | |||
391b85bea5 | |||
e24f3337a1 | |||
fdb5d070e4 | |||
ab8821aa4c | |||
4833a0a72e | |||
761f7cf482 | |||
fd349baa99 | |||
3c4e7d7858 | |||
756bfbc542 | |||
d235ac670d | |||
3a1f00ae34 |
@@ -1,12 +1,4 @@
|
|||||||
for source in colored_commands \
|
for source in $(find "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)" -type f | grep -Ev "_all|terminal_fancyfying"); do
|
||||||
convenience_aliases \
|
. "${source}"
|
||||||
docker_aliases \
|
|
||||||
git_functions \
|
|
||||||
histcontrol \
|
|
||||||
home_bin_folder \
|
|
||||||
ls_aliases \
|
|
||||||
safety_aliases \
|
|
||||||
terminal_colors \
|
|
||||||
terminal_fancyfying; do
|
|
||||||
. "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )/$source"
|
|
||||||
done
|
done
|
||||||
|
. "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)/terminal_fancyfying_${TERMINAL_FANCYFY}"
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
alias pubkey='cat ~/.ssh/id_*.pub'
|
alias pubkey='for PUBKEY_FILE in $(ls ~/.ssh/id_*.pub); do echo "${PUBKEY_FILE} :" | sed -e "s/.*id_//;s/\.pub//"; cat "${PUBKEY_FILE}"; echo; done'
|
||||||
alias hosts='sudo nano /etc/hosts'
|
alias hosts='sudo nano /etc/hosts'
|
||||||
alias historygrep='history | grep'
|
alias historygrep='history | grep'
|
||||||
alias sshconfig='nano ~/.ssh/config'
|
alias sshconfig='nano ~/.ssh/config'
|
||||||
alias bashrc='. ~/.bashrc'
|
alias bashrc='. ~/.bashrc'
|
||||||
alias sshagent='eval `ssh-agent` && ssh-add ~/.ssh/id_!(*.pub)'
|
alias sshagent='eval `ssh-agent` && ssh-add ~/.ssh/id_!(*.pub)'
|
||||||
|
alias sshfingerprint='ssh-keygen -lf'
|
||||||
|
alias nocomments='grep -vE "^$|^#|^;"'
|
||||||
alias newrepo='bash <(curl -s https://get.bjphoster.com/new-git-repo.sh)'
|
alias newrepo='bash <(curl -s https://get.bjphoster.com/new-git-repo.sh)'
|
||||||
alias newansibleworkspace='bash <(curl -s https://get.bjphoster.com/new-ansible-workspace.sh)'
|
alias newansibleworkspace='bash <(curl -s https://get.bjphoster.com/new-ansible-workspace.sh)'
|
||||||
|
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
|
alias dockerpull='docker compose pull'
|
||||||
alias dockerup='docker compose up'
|
alias dockerup='docker compose up'
|
||||||
alias dockerupd='docker compose up -d'
|
alias dockerupd='docker compose up -d'
|
||||||
alias dockerdown='docker compose down'
|
alias dockerdown='docker compose down'
|
||||||
alias dockerdownv='docker compose down --volumes'
|
alias dockerdownv='docker compose down --volumes'
|
||||||
alias dockerlogs='docker compose logs --tail=10'
|
alias dockerlogs='docker compose logs'
|
||||||
alias dockerlogsf='docker compose logs --tail=10 --follow'
|
alias dockerlogsf='docker compose logs --follow'
|
||||||
|
alias dockerlogst='docker compose logs --tail=10'
|
||||||
|
alias dockerlogstf='docker compose logs --tail=10 --follow'
|
||||||
|
58
deploy.sh
58
deploy.sh
@@ -1,14 +1,28 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
THIS="$(dirname "$(readlink -fm "$0")")"
|
THIS="$(dirname "$(readlink -fm "$0")")"
|
||||||
SERVER=false
|
FANCYFY="client"
|
||||||
|
CURRENT_FANCYFY=""
|
||||||
DELETE=false
|
DELETE=false
|
||||||
MOVE=false
|
MOVE=false
|
||||||
|
PRESENT=false
|
||||||
|
|
||||||
|
_bashrc_present() {
|
||||||
|
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
||||||
|
echo true
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
echo false
|
||||||
|
}
|
||||||
|
|
||||||
_arguments() {
|
_arguments() {
|
||||||
|
if [ "$(_bashrc_present)" = true ]; then
|
||||||
|
PRESENT=true
|
||||||
|
CURRENT_FANCYFY="$(grep TERMINAL_FANCYFY /home/bryanpedini/.bashrc | sed 's/.*=//')"
|
||||||
|
fi
|
||||||
for PARM in "$@"; do
|
for PARM in "$@"; do
|
||||||
if [ "${PARM}" = "--server" ]; then
|
if [ "${PARM}" = "--server" ]; then
|
||||||
SERVER=true
|
FANCYFY="server"
|
||||||
elif [ "${PARM}" = "--delete" ]; then
|
elif [ "${PARM}" = "--delete" ]; then
|
||||||
DELETE=true
|
DELETE=true
|
||||||
elif [ "${PARM}" = "--move" ]; then
|
elif [ "${PARM}" = "--move" ]; then
|
||||||
@@ -38,17 +52,18 @@ _help() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_delete() {
|
_delete() {
|
||||||
sed -i '/REF:bashrc_overrides:REF/{N;d}' ~/.bashrc
|
sed -i '/REF:bashrc_overrides:REF/{N;N;d}' ~/.bashrc
|
||||||
}
|
}
|
||||||
|
|
||||||
_bashrc_ref() {
|
_bashrc_ref() {
|
||||||
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
echo "#REF:bashrc_overrides:REF" >> ~/.bashrc
|
||||||
|
echo "export TERMINAL_FANCYFY=${1}" >> ~/.bashrc
|
||||||
echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
|
echo ". ${THIS}/bashrc_overrides/_all" >> ~/.bashrc
|
||||||
}
|
}
|
||||||
|
|
||||||
_move() {
|
_move() {
|
||||||
_delete
|
_delete
|
||||||
_bashrc_ref
|
_bashrc_ref "${FANCYFY}"
|
||||||
}
|
}
|
||||||
|
|
||||||
_main() {
|
_main() {
|
||||||
@@ -56,23 +71,34 @@ _main() {
|
|||||||
|
|
||||||
if [ "${DELETE}" = true ]; then
|
if [ "${DELETE}" = true ]; then
|
||||||
_delete
|
_delete
|
||||||
|
echo "removed custom configs"
|
||||||
elif [ "${MOVE}" = true ]; then
|
elif [ "${MOVE}" = true ]; then
|
||||||
_move
|
if [ "${PRESENT}" = false ]; then
|
||||||
elif [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
_bashrc_ref "${FANCYFY}"
|
||||||
echo "bash overrides already in place"
|
echo "unable to move to current directory"
|
||||||
echo "skipping..."
|
echo "bash overrides not previously present"
|
||||||
echo
|
echo "adding bash overrides..."
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
_move
|
||||||
|
echo "moved custom config directory to ${THIS}"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
|
elif [ "${PRESENT}" = true ]; then
|
||||||
|
if [ "${CURRENT_FANCYFY}" != "${FANCYFY}" ]; then
|
||||||
|
sed -i "s/TERMINAL_FANCYFY=${CURRENT_FANCYFY}/TERMINAL_FANCYFY=${FANCYFY}/" ~/.bashrc
|
||||||
|
echo "customized fancyfying"
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
echo "bash overrides already in place"
|
||||||
|
echo "skipping..."
|
||||||
|
echo
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
_bashrc_ref
|
_bashrc_ref "${FANCYFY}"
|
||||||
echo "bash overrides added"
|
echo "bash overrides added"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${SERVER}" = true ]; then
|
|
||||||
sed -i 's/terminal_fancyfying/terminal_fancyfying_server/' ${THIS}/bashrc_overrides/_all
|
|
||||||
else
|
|
||||||
sed -i 's/terminal_fancyfying_server/terminal_fancyfying/' ${THIS}/bashrc_overrides/_all
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_main "$@"
|
_main "$@"
|
||||||
|
Reference in New Issue
Block a user