| 12345678910111213141516171819202122232425262728293031323334 |
- #!/bin/bash
- # non interactive? exit!
- [[ $- != *i* ]] && return
- scriptname=$(basename ${BASH_SOURCE[0]})
- scriptdirname=$(dirname ${BASH_SOURCE[0]})
- function debug () {
- if [ -n "$DEBUG" ]; then
- echo -e "[${scriptname}]: $*" >&2
- fi
- }
- bashrc_debug="$HOME/.BASHRC_DEBUG"
- if [ -f "$bashrc_debug" ]; then
- DEBUG="$(cat $bashrc_debug)"
- debug "Debug enabled."
- fi
- BASHRC_DIR="$HOME/.bashrc.d"
- debug "BASHRC_DIR: '$BASHRC_DIR'"
- if [ -d "$BASHRC_DIR" ]; then
- for ext in $BASHRC_DIR/*sh; do
- if [ -f "$ext" ]; then
- debug "include '$ext'"
- . $ext
- fi
- done
- else
- debug"BASHRC_DIR: '$BASHRC_DIR' NOT FOUND!"
- fi
|