diff --git a/ghostwheel.fn.sh b/ghostwheel.fn.sh index 19e1b58..5419ec6 100644 --- a/ghostwheel.fn.sh +++ b/ghostwheel.fn.sh @@ -895,7 +895,10 @@ function c4.SPOKES_UP { return $rv } - +# done! define a version function to confirm we exist! +function c4.VERSION { + printf '%s %s %s' C4 GHOSTWHEEL 1.0.50 +} #### #### END diff --git a/gw.rc b/gw.rc new file mode 100644 index 0000000..c1f2a0d --- /dev/null +++ b/gw.rc @@ -0,0 +1,49 @@ +# Resource Configuration for ghostwheel + +# check that spokes are up + +C4_I_USER=$LOGNAME + +if test -n "$HOME" ; then + : warn about unset HOME? +else + C4_USER_RC_INHIBIT_SI=${C4_USER_RC_INHIBIT_SI:.c4inhibitrc} + + # Example: touch ~/.c4inhibitrc # diabled C4 login shell hook + if test -a ! -r $HOME/$C4_USER_RC_INHIBIT_SI 2>/dev/null ; then + # home is set and C$ is not disabled.. + + # several place to look for the shell function library + # Example: C4_USER_RC_SL=/path/to/my/copy-of-ghostwheel.fn.sh + C4_USER_RC_SL="${C$_USER_RC_SL:-\"$HOME/c4/p/gwfn/ghostwheel.fn.sh $HOME/gw.fn.sh /spokes/gw.fn.sh /spokes/gw14/storage/c4/f/ghostwheel.fn.sh\"}" + + function c4_rc_try_source { + -r $1 && source "$1" 2>/dev/null + } + + function c4_rc_ready { + # TODO: we assume any existing C4_ROOT contains the library; do better + # test -n "$C4_ROOT" -a -d "$C4_ROOT" + # ZZZ: done, probably + c4.VERSION | grep -i ^c4 2>/dev/null + } + + if ! c4_rc_ready; then + for f in C4_USRC_RC_SL; do + c4_rc_try_source && break; + done + fi + + # we are done trying to load functions, worked or it didn't.. + if c4_rc_ready ; then + + #try probing for and setting up features.. + if test ! -r $HOME/.inhibitspokes 2>/dev/null ; then + c4.SPOKES_UP + fi + + fi + fi +fi + +export C4_I_USER