Skip to content

Commit

Permalink
mode added
Browse files Browse the repository at this point in the history
  • Loading branch information
arcmags committed Nov 15, 2017
1 parent 18ddc70 commit f0b3417
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ <h1>Notes</h1>
<div class="section" id="issues-future-implementations">
<h1>Issues / Future Implementations</h1>
<ul class="simple">
<li>use <em>getopts</em> to allow grouping command line options together</li>
<li><em>--rsync</em> option (maybe use rsync automatically if installed)</li>
<li>test with full disk encryption</li>
<li><em>flush</em> action to sync the RAM filesystem back to the
Expand Down
2 changes: 2 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ often exhibit a dramatic improvement in RAM sync times.
Issues / Future Implementations
===================================

* use *getopts* to allow grouping command line options together

* *--rsync* option (maybe use rsync automatically if installed)

* test with full disk encryption
Expand Down
27 changes: 16 additions & 11 deletions ramroot
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ dirLib='/usr/lib/ramroot'
dirScript=
hookBuild="$dirLib/install/ramroot"
hookRuntime="$dirLib/hooks/ramroot"
incognitoMode='false'
initMODULES=
initHOOKS=
exitStatus=0
Expand Down Expand Up @@ -160,6 +161,9 @@ ramroot_enable() {
s@promptDefault=.*@promptDefault=\'$promptDefault\'@g; \
s@promptTimeout=.*@promptTimeout=\'$promptTimeout\'@g;" \
"$hookRuntime" > hooks/ramroot
if [ "$incognitoMode" = 'true' ]; then
sed -i '71i\ echo -e "\\e[0;30m"; clear' hooks/ramroot
fi
# FAIL: ramroot hooks not built:
if [ ! -f hooks/ramroot ] || [ ! -f install/ramroot ]; then
printf ":! ramroot hooks not built.\n"
Expand Down Expand Up @@ -355,17 +359,18 @@ dirScript="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# parse command line arguments:
for arg in "$@"; do case $arg in
disable) ramrootAction='disable'; shift;;
enable) ramrootAction='enable'; shift;;
remove) ramrootAction='remove'; shift;;
status) ramrootAction='status'; shift;;
-b|--boot) shift; bootUUID="$1"; shift;;
-D|--dryrun) dryRun='true'; shift;;
-H|-h|--help) ramrootAction='help'; shift;;
-K|--keep) keepBuildFiles='true'; shift;;
-N|--no) promptDefault='no'; shift;;
-r|--root) shift; rootUUID="$1"; shift;;
-t|--timeout) shift; promptTimeout="$1"; shift;;
disable) ramrootAction='disable'; shift;;
enable) ramrootAction='enable'; shift;;
remove) ramrootAction='remove'; shift;;
status) ramrootAction='status'; shift;;
-b|--boot) shift; bootUUID="$1"; shift;;
-D|--dryrun) dryRun='true'; shift;;
-H|-h|--help) ramrootAction='help'; shift;;
-I|--incognito) incognitoMode='true'; shift;;
-K|--keep) keepBuildFiles='true'; shift;;
-N|--no) promptDefault='no'; shift;;
-r|--root) shift; rootUUID="$1"; shift;;
-t|--timeout) shift; promptTimeout="$1"; shift;;
esac; done

# print help:
Expand Down

0 comments on commit f0b3417

Please sign in to comment.