-this_host=
-# gets the machine's hostname and stores it in the variable "this_host".
-function get_our_hostname()
-{
- if [ "$OS" == "Windows_NT" ]; then
- this_host=$(hostname)
- elif [ ! -z "$(echo $MACHTYPE | grep apple)" ]; then
- this_host=$(hostname)
- elif [ ! -z "$(echo $MACHTYPE | grep suse)" ]; then
- this_host=$(hostname --long)
- else
- this_host=$(hostname)
- fi
- #echo "hostname is $this_host"
-}
-
-# this function sets a variable called "home_system" to "true" if the
-# machine is considered one of fred's home machines. if you are not
-# fred, you may want to change the machine choices.
-export home_system=
-function is_home_system()
-{
- # load up the name of the host.
- get_our_hostname
- # reset the variable that we'll be setting.
- home_system=
- if [[ $this_host == *.gruntose.blurgh ]]; then
- home_system=true
- fi
-}
-
-#hmmm: move to core.
-# makes sure that the "folder" is a directory and is writable.
-# remember that bash successful returns are zeroes...
-function test_writeable()
-{
- local folder="$1"; shift
- if [ ! -d "$folder" -o ! -w "$folder" ]; then return 1; fi
- return 0
-}