summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2012-06-11 16:36:33 +0200
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2012-06-11 16:36:33 +0200
commite7d301d0c1ac4849d79aeadd2a879e120631ba7c (patch)
tree1eeabcd22b9f4fca4045d3ec272f50a093d29066
parent474f963e21b0cf30cb5ad313e1656aea0c276d0c (diff)
downloaddotfiles-e7d301d0c1ac4849d79aeadd2a879e120631ba7c.tar.gz
dotfiles-e7d301d0c1ac4849d79aeadd2a879e120631ba7c.tar.xz
dotfiles-e7d301d0c1ac4849d79aeadd2a879e120631ba7c.zip
bashrc: add possibility to change settings based on the domain
Diffstat (limited to '')
-rw-r--r--bashrc/main.sh2
-rw-r--r--bashrc/net/init.sh7
2 files changed, 9 insertions, 0 deletions
diff --git a/bashrc/main.sh b/bashrc/main.sh
index 27c5414..01ca309 100644
--- a/bashrc/main.sh
+++ b/bashrc/main.sh
@@ -115,6 +115,7 @@ _load() {
case $1 in
(dist) path=${_DISTNAME}/${2}.sh ;;
(node) path=${_NODENAME}/${2}.sh ;;
+ (net) path=${_NETNAME}/${2}.sh ;;
esac
fi
@@ -139,6 +140,7 @@ _load common '*'
# load internals
_load dist init
_load node init
+_load net init
# load common distribution settings
_load dist common
diff --git a/bashrc/net/init.sh b/bashrc/net/init.sh
new file mode 100644
index 0000000..61f64f2
--- /dev/null
+++ b/bashrc/net/init.sh
@@ -0,0 +1,7 @@
+# get net specific data
+declare -r _FQDN=$(hostname -f)
+declare -r _NETNAME=${_FQDN#*.}
+
+if [[ -n "${_NETNAME}" ]]; then
+ _load net '*'
+fi