Skip to content

Commit

Permalink
enable sudo -i $cmd by appending root's profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuseteam committed Apr 14, 2024
1 parent e504d2f commit ff5b874
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crackle
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ APT_CACHE="apt-cache -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE -o Dir::Etc
[[ -z "$(ls $SCRP_DIR/bin)" && $(basename $SCRP_DIR) != "bin" ]] && err "submodule missing";
bashrc=$(grep crackle "$HOME"/.bashrc);
profile=$(grep crackle "$HOME"/.profile);
rootprofile=$(grep crackle /root/.profile);

[[ -d "$PKG_PATH" ]] || mkdir -p "$PKG_PATH";

Expand Down Expand Up @@ -191,6 +192,10 @@ APT_CACHE="apt-cache -o Dir::Cache=$APTCACHE -o Dir::State=$APTSTATE -o Dir::Etc
say "Amending ~/.profile...";
_crackleconf -v start="#cracklerc" "$SCRP_DIR"/crackle.conf >> "$HOME"/.profile;
}
[[ -z "$rootprofile" ]] && {
say "Amending /root/.profile...";
_crackleconf -v start="#rootprofile" "$SCRP_DIR"/crackle.conf | sudo -k tee --append /root/.profile > /dev/null;
}

[[ -d "$PKG_PREFIX/lib/crackle" ]] || mkdir -p "$PKG_PREFIX/lib/crackle";

Expand Down
5 changes: 5 additions & 0 deletions crackle.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

[ -f "${XDG_CONFIG_HOME:-$HOME/.config}/crackle/cracklerc" ] && . "${XDG_CONFIG_HOME:-$HOME/.config}/crackle/cracklerc"
###
#rootprofile

PATH="$HOME/.local/bin:$PATH"
[ -f "${XDG_CONFIG_HOME:-/home/phablet/.config}/crackle/cracklerc" ] && . "${XDG_CONFIG_HOME:-/home/phablet/.config}/crackle/cracklerc"
###

0 comments on commit ff5b874

Please sign in to comment.