aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/ak2
-rwxr-xr-xbin/ak-maintainance5
-rwxr-xr-xlib/_ak_maintainance13
3 files changed, 16 insertions, 4 deletions
diff --git a/bin/ak b/bin/ak
index 5277fad..a18eca0 100755
--- a/bin/ak
+++ b/bin/ak
@@ -30,6 +30,8 @@ export AK_DEBUG="yes"
##
## -h, --help Prints this help message
##
+## -s, --shell Starts an interactive shell
+##
## -m, --module [module] Run a specified module. If no module provided
## the list of available modules will be printed.
##
diff --git a/bin/ak-maintainance b/bin/ak-maintainance
index e3c22a1..c9b3aa1 100755
--- a/bin/ak-maintainance
+++ b/bin/ak-maintainance
@@ -41,8 +41,9 @@ if [ ! -z $1 ]
then
case $1 in
-h | --help) _ak_usage; exit;;
- -r | --restore) _ak_restore $2; exit;;
- -b | --backup) _ak_backup; exit;;
+ -r | --restore) _ak_maintainance_restore $2; exit;;
+ -b | --backup) _ak_maintainance_backup; exit;;
+ -n | --nuke) _ak_maintainance_nuke_all_but_core; exit;;
* ) _ak_usage;;
esac
else _ak_usage
diff --git a/lib/_ak_maintainance b/lib/_ak_maintainance
index f67c815..fd03573 100755
--- a/lib/_ak_maintainance
+++ b/lib/_ak_maintainance
@@ -20,7 +20,7 @@
source $AK_LIBDIR/_ak_log
source $AK_LIBDIR/_ak_script
-function _ak_backup(){
+function _ak_maintainance_backup(){
if [ -n "${AK_WORKDIR}" ] && [ -d "${AK_WORKDIR}" ]
then
if [ -n "${AK_ROOT}" ] && [ -d "${AK_ROOT}" ]
@@ -44,7 +44,7 @@ function _ak_backup(){
fi
}
-function _ak_restore(){
+function _ak_maintainance_restore(){
if [ -n "${AK_WORKDIR}" ] && [ -d "${AK_WORKDIR}" ]
then
_ak_log_error "${AK_WORKDIR} already exists! Aborting..."
@@ -73,3 +73,12 @@ function _ak_restore(){
fi
fi
}
+
+function _ak_maintainance_nuke_all_but_core(){
+ if [ -n "${AK_WORKDIR}" ] && [ -d "${AK_WORKDIR}" ]
+ then
+ export | grep '^AK_'
+ else
+ _ak_log_error "No AK_WORKDIR found or it does not exist"
+ fi
+}