From 68b031f0b7ecb055e3e4886fc0f9c5ecda894d3a Mon Sep 17 00:00:00 2001 From: janith cooray Date: Sun, 27 Oct 2024 12:34:52 +0530 Subject: [PATCH] fix ui bug, fix debug print --- module/customize.sh | 2 +- module/service.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/module/customize.sh b/module/customize.sh index 80f5de8..322fc99 100644 --- a/module/customize.sh +++ b/module/customize.sh @@ -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 } diff --git a/module/service.sh b/module/service.sh index 9d2d572..1c5df63 100644 --- a/module/service.sh +++ b/module/service.sh @@ -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 } @@ -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 @@ -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!