aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-fs-add
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.org>2024-06-10 12:25:06 +0300
committerkaotisk <kaotisk@arching-kaos.org>2024-06-10 12:25:06 +0300
commitf654a9fcf2c3c5e348ea43a341e973a0ccbca7c7 (patch)
tree82423c4d4f34eb51dee2f0e1ccdcf96c1f6bb16f /bin/ak-fs-add
parentae9726f747b2ec3e5805d03ef04ad47cb7628315 (diff)
downloadarching-kaos-tools-f654a9fcf2c3c5e348ea43a341e973a0ccbca7c7.tar.gz
arching-kaos-tools-f654a9fcf2c3c5e348ea43a341e973a0ccbca7c7.tar.bz2
arching-kaos-tools-f654a9fcf2c3c5e348ea43a341e973a0ccbca7c7.zip
Refactoring
Diffstat (limited to 'bin/ak-fs-add')
-rwxr-xr-xbin/ak-fs-add14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/ak-fs-add b/bin/ak-fs-add
index f22432b..0a9f636 100755
--- a/bin/ak-fs-add
+++ b/bin/ak-fs-add
@@ -65,7 +65,7 @@ rm -rf $TEMPORARYDIR
if [ ! -d "$TECHDIR" ]
then
mkdir -p "$TECHDIR"
- if [ $? == 0 ]
+ if [ $? -eq 0 ]
then
logit "INFO" "Folder $TECHDIR created!"
else
@@ -80,7 +80,7 @@ fi
if [ ! -d "$FILEMAPSDIR" ]
then
mkdir -p "$FILEMAPSDIR"
- if [ $? == 0 ]
+ if [ $? -eq 0 ]
then
logit "INFO" "Folder $FILEMAPSDIR created!"
else
@@ -95,7 +95,7 @@ fi
if [ ! -d "$CHKDIR" ]
then
mkdir -p "$CHKDIR"
- if [ $? == 0 ]
+ if [ $? -eq 0 ]
then
logit "INFO" "Folder $CHKDIR created!"
else
@@ -110,7 +110,7 @@ fi
if [ ! -d "$MERKLEDIR" ]
then
mkdir -p "$MERKLEDIR"
- if [ $? == 0 ]
+ if [ $? -eq 0 ]
then
logit "INFO" "Folder $MERKLEDIR created!"
else
@@ -153,7 +153,7 @@ do
done
# Append last chk if not even number
appendLastIfNotEven(){
- if [ "$(expr $(wc -l "$1" | awk '{ print $1 }') % 2)" != 0 ]
+ if [ "$(( $(wc -l "$1" | awk '{ print $1 }') % 2))" -ne 0 ]
then
tail -n 1 "$1" >> "$1"
fi
@@ -163,7 +163,7 @@ appendLastIfNotEven "$TEMPORARYDIR/map"
totalChunks=`grep 'chk' $TEMPORARYDIR/map | wc -l`
temp="$totalChunks"
timesRan=0
-while [ $temp != 1 ]
+while [ $temp -ne 1 ]
do
temp=`expr $temp / 2`
timesRan=`expr $timesRan + 1`
@@ -173,7 +173,7 @@ printf "Total chunks %s \n" "$totalChunks"
workingIndex="$TEMPORARYDIR/map"
c=$timesRan
-while [ "$c" != 0 ]
+while [ $c -ne 0 ]
do
a=1
printf "Level: %s, will work on %s chunks\n" "$c" "$totalChunks"