You've already forked personal-linux-config
Compare commits
4 Commits
0.5.0
...
dc984eb128
Author | SHA1 | Date | |
---|---|---|---|
dc984eb128 | |||
5d6c22f1b8 | |||
c53a382a4f | |||
bcaffe612c |
@@ -8,8 +8,9 @@ alias sshfingerprint='ssh-keygen -lf'
|
|||||||
alias nocomments='grep -vE "^$|^#|^;"'
|
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)'
|
||||||
|
alias infinitenothing='while true; do sleep 1; done'
|
||||||
|
|
||||||
alias sambaserver='docker run -it --rm --network host -p 137:137 -p 138:138 -p 139:139 -p 445:445 -v `pwd`:/share dperson/samba -n -p -s "sambashare;/share;yes;no;no;shareuser" -w "WORKGROUP"'
|
alias sambaserver='docker run -it --rm -p 137:137 -p 138:138 -p 139:139 -p 445:445 -v `pwd`:/share dperson/samba -n -p -s "share;/share;yes;no;yes" -w "WORKGROUP"'
|
||||||
alias acme.sh='docker run -it --rm -v ~/acme.sh:/acme.sh neilpang/acme.sh'
|
alias acme.sh='docker run -it --rm -v ~/acme.sh:/acme.sh neilpang/acme.sh'
|
||||||
alias termbin='nc termbin.com 9999'
|
alias termbin='nc termbin.com 9999'
|
||||||
alias dnsversion='dig txt chaos version.bind'
|
alias dnsversion='dig txt chaos version.bind'
|
||||||
|
33
deploy.sh
33
deploy.sh
@@ -6,9 +6,10 @@ CURRENT_FANCYFY=""
|
|||||||
DELETE=false
|
DELETE=false
|
||||||
MOVE=false
|
MOVE=false
|
||||||
PRESENT=false
|
PRESENT=false
|
||||||
|
BASHRC="~/.bashrc"
|
||||||
|
|
||||||
_bashrc_present() {
|
_bashrc_present() {
|
||||||
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ~/.bashrc)" ]; then
|
if [ ! -z "$(grep "#REF:bashrc_overrides:REF" ${BASHRC})" ]; then
|
||||||
echo true
|
echo true
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
@@ -18,7 +19,7 @@ _bashrc_present() {
|
|||||||
_arguments() {
|
_arguments() {
|
||||||
if [ "$(_bashrc_present)" = true ]; then
|
if [ "$(_bashrc_present)" = true ]; then
|
||||||
PRESENT=true
|
PRESENT=true
|
||||||
CURRENT_FANCYFY="$(grep TERMINAL_FANCYFY /home/bryanpedini/.bashrc | sed 's/.*=//')"
|
CURRENT_FANCYFY="$(grep TERMINAL_FANCYFY ${BASHRC} | sed 's/.*=//')"
|
||||||
fi
|
fi
|
||||||
for PARM in "$@"; do
|
for PARM in "$@"; do
|
||||||
if [ "${PARM}" = "--server" ]; then
|
if [ "${PARM}" = "--server" ]; then
|
||||||
@@ -43,7 +44,7 @@ _help() {
|
|||||||
echo " --force"
|
echo " --force"
|
||||||
echo " Force the reinstallation of the files"
|
echo " Force the reinstallation of the files"
|
||||||
echo " --delete"
|
echo " --delete"
|
||||||
echo " Delete the reference in ~/.bashrc"
|
echo " Delete the reference in ${BASHRC}"
|
||||||
echo " --move"
|
echo " --move"
|
||||||
echo " Create a new reference if the location of this folder has been changed"
|
echo " Create a new reference if the location of this folder has been changed"
|
||||||
echo " --server"
|
echo " --server"
|
||||||
@@ -52,18 +53,18 @@ _help() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_delete() {
|
_delete() {
|
||||||
sed -i '/REF:bashrc_overrides:REF/{N;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 "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() {
|
||||||
@@ -73,12 +74,20 @@ _main() {
|
|||||||
_delete
|
_delete
|
||||||
echo "removed custom configs"
|
echo "removed custom configs"
|
||||||
elif [ "${MOVE}" = true ]; then
|
elif [ "${MOVE}" = true ]; then
|
||||||
_move
|
if [ "${PRESENT}" = false ]; then
|
||||||
echo "moved custom config directory to ${THIS}"
|
_bashrc_ref "${FANCYFY}"
|
||||||
echo
|
echo "unable to move to current directory"
|
||||||
|
echo "bash overrides not previously present"
|
||||||
|
echo "adding bash overrides..."
|
||||||
|
echo
|
||||||
|
else
|
||||||
|
_move
|
||||||
|
echo "moved custom config directory to ${THIS}"
|
||||||
|
echo
|
||||||
|
fi
|
||||||
elif [ "${PRESENT}" = true ]; then
|
elif [ "${PRESENT}" = true ]; then
|
||||||
if [ "${CURRENT_FANCYFY}" != "${FANCYFY}" ]; then
|
if [ "${CURRENT_FANCYFY}" != "${FANCYFY}" ]; then
|
||||||
sed -i "s/TERMINAL_FANCYFY=${CURRENT_FANCYFY}/TERMINAL_FANCYFY=${FANCYFY}/" ~/.bashrc
|
sed -i "s/TERMINAL_FANCYFY=${CURRENT_FANCYFY}/TERMINAL_FANCYFY=${FANCYFY}/" "${BASHRC}"
|
||||||
echo "customized fancyfying"
|
echo "customized fancyfying"
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user