#!/usr/bin/env bash export local portagedir="/usr/portage" export local confdir="/etc/portage" reset_current_mode() { if [ -d ""$portagedir"/.git" ] ; then rm -rf $(find "$portagedir" -mindepth 1 | grep -v "distfiles" | grep -v "packages") rm ""$confdir"/make.conf" rm ""$confdir"/make.profile" rm "$confdir" fi } main () { reset_current_mode } main