| 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
- bashrcDir="$HOME/.bashrc.d"
- debug "bashrcDir: '$bashrcDir'"
- if [ -d "$bashrcDir" ]; then
- for ext in $bashrcDir/*sh; do
- if [ -f "$ext" ]; then
- debug "include '$ext'"
- . $ext
- fi
- done
- else
- debug"bashrcDir: '$bashrcDir' NOT FOUND!"
- fi
|