diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-04-04 09:39:47 +0300 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-04-04 09:39:47 +0300 |
commit | 946d002543083d9561bb1e7f851b8179099ad077 (patch) | |
tree | 63c0689b9510a5e6dcfcac4b1c1140079a3a1f6d /bin/ak-fs-add | |
parent | 25cabe789a20e39e666dc56348cb32d0d1714dbd (diff) | |
download | arching-kaos-tools-946d002543083d9561bb1e7f851b8179099ad077.tar.gz arching-kaos-tools-946d002543083d9561bb1e7f851b8179099ad077.tar.bz2 arching-kaos-tools-946d002543083d9561bb1e7f851b8179099ad077.zip |
Deployed space lazers to eliminate tabbed spaces
- Also: _ak_not_implemented introduced
Diffstat (limited to 'bin/ak-fs-add')
-rwxr-xr-x | bin/ak-fs-add | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/bin/ak-fs-add b/bin/ak-fs-add index d00367d..34ee3c0 100755 --- a/bin/ak-fs-add +++ b/bin/ak-fs-add @@ -24,12 +24,20 @@ # Uncomment next line if you want to debug # set -xe PROGRAM="$(basename $0)" +source $AK_LIBDIR/_ak_fs +source $AK_LIBDIR/_ak_log if [ ! -f "$1" ] then - echo "ERROR File not found" + logit "ERROR" "File $1 not found" exit 1 else + # TODO + # Side hustle, save the original hash and original filename + # This won't be expected in general + # The idea is: + # sha256sum as quick pointer to root of the tree + # base64 $1 > file FILE="file" fi @@ -57,12 +65,11 @@ rm -rf $TEMPORARYDIR if [ ! -d "$TECHDIR" ] then mkdir -p "$TECHDIR" - if [ "$?" == 0 ] + if [ $? == 0 ] then logit "INFO" "Folder $TECHDIR created!" else logit "ERROR" "Problem occured while creating $TECHDIR" - echo "ERROR Can't create $TECHDIR" exit 1 fi else @@ -73,12 +80,11 @@ fi if [ ! -d "$FILEMAPSDIR" ] then mkdir -p "$FILEMAPSDIR" - if [ "$?" == 0 ] + if [ $? == 0 ] then logit "INFO" "Folder $FILEMAPSDIR created!" else logit "ERROR" "Problem occured while creating $FILEMAPSDIR" - echo "ERROR Can't create $FILEMAPSDIR" exit 1 fi else @@ -89,12 +95,11 @@ fi if [ ! -d "$CHKDIR" ] then mkdir -p "$CHKDIR" - if [ "$?" == 0 ] + if [ $? == 0 ] then logit "INFO" "Folder $CHKDIR created!" else logit "ERROR" "Problem occured while creating $CHKDIR" - echo "ERROR Can't create $CHKDIR" exit 1 fi else @@ -105,7 +110,7 @@ fi if [ ! -d "$MERKLEDIR" ] then mkdir -p "$MERKLEDIR" - if [ "$?" == 0 ] + if [ $? == 0 ] then logit "INFO" "Folder $MERKLEDIR created!" else |