Skip to content

Commit

Permalink
fix ui bug, fix debug print
Browse files Browse the repository at this point in the history
  • Loading branch information
janithcooray authored Oct 27, 2024
1 parent 83b2073 commit 68b031f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion module/customize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function custom_install() {
ui_print "- Version $SWAP_MOD_VERSION"
ui_print "- SWAP-SIZE: $SWAP_BIN_SIZE (MB)"
ui_print "- SWAPPINESS: $SWAPPINESS"
ui_print "- SWAP_FILE_PRIOR: $SWAPPINESS"
ui_print "- SWAP_FILE_PRIOR: $SWAP_FILE_PRIOR"
create_swapfile
enable_swapfile
}
Expand Down
13 changes: 7 additions & 6 deletions module/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ function print_log(){
function check_file(){
print_log "Checking if $1 Exists"
if [ -e $1 ]; then
echo "File exists."
print_log "File exists."
else
echo "File does not exist."
print_log "File does not exist."
fi
}

function check_bin(){
if command -v $1 >/dev/null 2>&1; then
echo "$1 exists."
print_log "$1 exists."
else
echo "$1 does not exist."
print_log "$1 does not exist."
fi
}

Expand All @@ -33,6 +33,7 @@ function check_bin(){
check_file "/system/bin/swapon"
check_bin "swapon"
check_bin "sysctl"
check_bin "whereis"

if [ -e "/data/swap/INCOMPLETE" ]; then
echo "$now : INCOMPLETE FILE still exists! Did it Fail to boot?" >> /data/swap/swapfile.log
Expand All @@ -43,9 +44,9 @@ else
sysctl vm.swappiness=$SWAPPINESS
# At this point if it fails, it will exit the script leaving /data/swap/INCOMPLETE
if [[ "$SWAP_FILE_PRIOR" -eq 0 ]]; then
/system/bin/swapon /data/swap/swapfile >> /data/swap/swapfile.log
swapon /data/swap/swapfile >> /data/swap/swapfile.log
else
/system/bin/swapon -p $SWAP_FILE_PRIOR /data/swap/swapfile >> /data/swap/swapfile.log
swapon -p $SWAP_FILE_PRIOR /data/swap/swapfile >> /data/swap/swapfile.log
fi
fi
# Service BOOT OK!
Expand Down

0 comments on commit 68b031f

Please sign in to comment.