X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Fconnect_feisty_meow.sh;fp=scripts%2Fcore%2Fconnect_feisty_meow.sh;h=6a226b8dfe3e8c15b4c670e084a2f89154922c58;hb=c589a3686d4508c9c5ea7841deb9be251460ddc3;hp=9a5c81d548bb3b98b6b22e36a3009641f6cdb868;hpb=4c595ba63a6c5203e104fe83fee43d69d3ff7aef;p=feisty_meow.git diff --git a/scripts/core/connect_feisty_meow.sh b/scripts/core/connect_feisty_meow.sh index 9a5c81d5..6a226b8d 100644 --- a/scripts/core/connect_feisty_meow.sh +++ b/scripts/core/connect_feisty_meow.sh @@ -11,16 +11,31 @@ export FEISTY_MEOW_APEX="$( \cd "$WORKDIR/../.." && \pwd )" echo calculated apex as $FEISTY_MEOW_APEX +do_root="$1"; shift + if [ -f "$HOME/.bashrc" ] && grep -q "launch_feisty_meow.sh" "$HOME/.bashrc"; then # the stanza for loading feisty meow already seems to be present. echo "Feisty Meow already seems to be configured in '~/.bashrc'." else - # stuff the normal user init file into .bashrc. not appropriate for root probably, but - # this is the easy quick start script for normal folks. - cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user | - sed -e \ - "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \ - >> "$HOME/.bashrc" - echo "Feisty Meow is now configured in '~/.bashrc'." + # check for the --root flag to see if they're trying to get the root version of inits. + if [ "$do_root" != "--root" ]; then + # stuff the "normal user" init file into .bashrc. not appropriate for root. + # this is the easy and quick start script for most folks. + cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-normal-user | + sed -e \ + "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \ + >> "$HOME/.bashrc" + echo "Feisty Meow is now configured in '~/.bashrc' for standard users." + else + # stuff the root user init file into .bashrc. this one doesn't automatically load + # feisty meow. instead, it provides a fredme macro to load the feisty meow scripts. + # fredme comes from the main author being fred t. hamster. we have since added a + # feistyme macro too, to be less personalized... + cat $FEISTY_MEOW_APEX/infobase/feisty_inits/dot.bashrc-root | + sed -e \ + "s?FEISTY_MEOW_APEX=\".*\"?FEISTY_MEOW_APEX=\"$FEISTY_MEOW_APEX\"?" \ + >> "$HOME/.bashrc" + echo "Feisty Meow is now configured in '~/.bashrc' for the root user." + fi fi