diff options
author | kaotisk <kaotisk@arching-kaos.org> | 2024-03-18 02:07:52 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.org> | 2024-03-18 02:07:52 +0200 |
commit | 759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0 (patch) | |
tree | cf521106526cf5b732ce3f4c3cea027ab35fa5e7 | |
parent | 8c63f5493b101b1af9653c2af120c56d98c811a4 (diff) | |
download | arching-kaos-tools-759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0.tar.gz arching-kaos-tools-759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0.tar.bz2 arching-kaos-tools-759e6efd5cd5ad0c3d0d0ca3fe0c053311e92de0.zip |
Renamed lib logit to _ak_logit
Affected scripts:
- ak
- ak-articles
- ak-categories
- ak-comments
- ak-data-expand
- ak-enter
- ak-files
- ak-find-latest-mined-sblock
- ak-folders
- ak-follow
- ak-following
- ak-fs-add
- ak-ipfs-check
- ak-ipns-resolve
- ak-news
- ak-profile
- ak-schain-latest-cached
- ak-sm-files
- ak-sm-filesplitter
- ak-stellar-get-participants
- ak-tempassin
- ak-todos
- ak-transactions
- ak-zblock-cache
- ak-zblock-manipulator
- ak-zblock-pack
- ak-zblock-show
- ak-zchain-chk
-rwxr-xr-x | bin/ak | 2 | ||||
-rwxr-xr-x | bin/ak-articles | 18 | ||||
-rwxr-xr-x | bin/ak-categories | 19 | ||||
-rwxr-xr-x | bin/ak-comments | 2 | ||||
-rwxr-xr-x | bin/ak-data-expand | 2 | ||||
-rwxr-xr-x | bin/ak-enter | 2 | ||||
-rwxr-xr-x | bin/ak-files | 2 | ||||
-rwxr-xr-x | bin/ak-find-latest-mined-sblock | 2 | ||||
-rwxr-xr-x | bin/ak-folders | 2 | ||||
-rwxr-xr-x | bin/ak-follow | 2 | ||||
-rwxr-xr-x | bin/ak-following | 2 | ||||
-rwxr-xr-x | bin/ak-fs-add | 2 | ||||
-rwxr-xr-x | bin/ak-ipfs-check | 2 | ||||
-rwxr-xr-x | bin/ak-ipns-resolve | 2 | ||||
-rwxr-xr-x | bin/ak-news | 2 | ||||
-rwxr-xr-x | bin/ak-profile | 2 | ||||
-rwxr-xr-x | bin/ak-schain-latest-cached | 2 | ||||
-rwxr-xr-x | bin/ak-sm-files | 2 | ||||
-rwxr-xr-x | bin/ak-sm-filesplitter | 2 | ||||
-rwxr-xr-x | bin/ak-stellar-get-participants | 2 | ||||
-rwxr-xr-x | bin/ak-tempassin | 2 | ||||
-rwxr-xr-x | bin/ak-todos | 2 | ||||
-rwxr-xr-x | bin/ak-transactions | 2 | ||||
-rwxr-xr-x | bin/ak-zblock-cache | 2 | ||||
-rwxr-xr-x | bin/ak-zblock-manipulator | 2 | ||||
-rwxr-xr-x | bin/ak-zblock-pack | 2 | ||||
-rwxr-xr-x | bin/ak-zblock-show | 2 | ||||
-rwxr-xr-x | bin/ak-zchain-chk | 2 | ||||
-rwxr-xr-x | lib/_ak_logit (renamed from lib/logit) | 0 |
29 files changed, 37 insertions, 52 deletions
@@ -1,7 +1,7 @@ #!/bin/bash PROGRAM=$(basename $0) -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ $# -eq 0 ] then diff --git a/bin/ak-articles b/bin/ak-articles index 248f425..4b76776 100755 --- a/bin/ak-articles +++ b/bin/ak-articles @@ -3,23 +3,7 @@ PROGRAM=$(basename $0) descriptionString="Articles module for Arching Kaos" -source $AK_LIBDIR/logit - -new_line(){ - printf '\n' -} -description(){ - full_title="$(printf '%s - %s' "$PROGRAM" "$descriptionString")" - delimiter_count=`echo -n $full_title | wc -c` - printf '%s' "$full_title" - new_line - while [ $delimiter_count -gt 0 ] - do - printf '=' - delimiter_count=$(($delimiter_count-1)) - done - new_line -} +source $AK_LIBDIR/_ak_logit ZARTICLESDIR="$AK_WORKDIR/articles" TEMP="/tmp/aktmp" diff --git a/bin/ak-categories b/bin/ak-categories index e50e1fc..292e789 100755 --- a/bin/ak-categories +++ b/bin/ak-categories @@ -2,13 +2,14 @@ AK_CATEGORIES="$AK_WORKDIR/categories" PROGRAM="$(basename $0)" -echo $AK_CATEGORIES +source $AK_LIBDIR/_ak_logit + if [ ! -d $AK_CATEGORIES ]; then mkdir $AK_CATEGORIES cd $AK_CATEGORIES - echo "AK_CATEGORIES created" + logit "INFO" "AK_CATEGORIES created" else - echo "AK_CATEGORIES found" + logit "INFO" "AK_CATEGORIES found" fi _ak_modules_categories_create(){ @@ -16,7 +17,7 @@ _ak_modules_categories_create(){ cd $TEMP export NEWS_FILE="$(date +%Y%m%d_%H%M%S)" vi $NEWS_FILE - echo "Renaming..." + logit "INFO" "Renaming..." TITLE="$(head -n 1 $NEWS_FILE)" TO_FILE=$NEWS_FILE-$(echo $TITLE | tr '[:upper:]' '[:lower:]' | sed -e 's/ /\_/g' ) IPFS_FILE=$(ak-ipfs-add $NEWS_FILE) @@ -46,10 +47,10 @@ _ak_modules_categories_import(){ then if [ ! -d $1 ] then - echo "Folder does not exists" + logit "ERROR" "Folder does not exists" exit 4 else - echo "Folder $1 exists" + logit "INFO" "Folder $1 exists" fl="$(ls -1 $1)" for f in $fl do @@ -57,7 +58,7 @@ _ak_modules_categories_import(){ done fi else - echo "No value" + logit "ERROR" "No value" exit 6 fi exit 224 @@ -67,7 +68,7 @@ _ak_modules_categories_add(){ cd $TEMP if [ -f $1 ]; then FILE="$1" - echo "Adding news from " $FILE + logit "INFO" "Adding news from " $FILE DATETIME=$(echo $FILE | cut -d - -f 1 | awk '{print $1}') TITLE=$(head -n 1 $FILE) FILE_IPFS_HASH=$(ak-ipfs-add $FILE) @@ -105,7 +106,7 @@ _ak_modules_categories_usage(){ echo " newsletter and it's going to be saved" exit 0 } -_ak_modules_categories_title + if [ ! -z $1 ]; then case $1 in -h | --help) _ak_modules_categories_usage; exit;; diff --git a/bin/ak-comments b/bin/ak-comments index 590df45..9e26e7d 100755 --- a/bin/ak-comments +++ b/bin/ak-comments @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit ZCOMMENTSDIR="$AK_WORKDIR/comments" TEMP="/tmp/aktmp" diff --git a/bin/ak-data-expand b/bin/ak-data-expand index 3e194a3..0c79741 100755 --- a/bin/ak-data-expand +++ b/bin/ak-data-expand @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d $AK_WORKDIR/ipfs ] then diff --git a/bin/ak-enter b/bin/ak-enter index a28914d..a6f7a66 100755 --- a/bin/ak-enter +++ b/bin/ak-enter @@ -18,7 +18,7 @@ # Logs messages to $LOGSFILE. PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit usage(){ echo "$PROGRAM - Crawl an arching kaos chain" diff --git a/bin/ak-files b/bin/ak-files index 626bc2b..2280cce 100755 --- a/bin/ak-files +++ b/bin/ak-files @@ -3,7 +3,7 @@ ZFILESDIR="$AK_WORKDIR/files" TEMP="/tmp/aktmp" PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d $ZFILESDIR ]; then mkdir $ZFILESDIR diff --git a/bin/ak-find-latest-mined-sblock b/bin/ak-find-latest-mined-sblock index ca435de..ce147d4 100755 --- a/bin/ak-find-latest-mined-sblock +++ b/bin/ak-find-latest-mined-sblock @@ -3,7 +3,7 @@ MINED_BLOCKS_DIR="/home/$USER/.arching-kaos/mined_blocks" cd $MINED_BLOCKS_DIR PROGRAM="$(basename $0)" declare -A counters -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit further(){ # logit "INFO" "Diving into $1" diff --git a/bin/ak-folders b/bin/ak-folders index 23fe0b9..b5f2601 100755 --- a/bin/ak-folders +++ b/bin/ak-folders @@ -4,7 +4,7 @@ PROGRAM="$(basename $0)" ZFOLDERSDIR="$AK_WORKDIR/folders" TEMP="/tmp/aktmp" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d $ZFOLDERSDIR ]; then mkdir $ZFOLDERSDIR diff --git a/bin/ak-follow b/bin/ak-follow index 0e6529c..e0e7336 100755 --- a/bin/ak-follow +++ b/bin/ak-follow @@ -1,7 +1,7 @@ #!/bin/bash FOLLOWING="$HOME/.arching-kaos/following" PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -z $1 ] then diff --git a/bin/ak-following b/bin/ak-following index dc21aa4..440a2c0 100755 --- a/bin/ak-following +++ b/bin/ak-following @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit FOLLOWING="$HOME/.arching-kaos/following" if [ -f $FOLLOWING ] diff --git a/bin/ak-fs-add b/bin/ak-fs-add index 1c05b03..e579212 100755 --- a/bin/ak-fs-add +++ b/bin/ak-fs-add @@ -47,7 +47,7 @@ TECHDIR="$TEMPORARYDIR/chks/" CURRENTDIR="$(pwd)/" # Our snippet for logging debug info -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit # Checking directories and create them if necessary rm -rf $TEMPORARYDIR diff --git a/bin/ak-ipfs-check b/bin/ak-ipfs-check index c089ee7..f74f040 100755 --- a/bin/ak-ipfs-check +++ b/bin/ak-ipfs-check @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit ak-ipfs-files-ls /zarchive > /dev/null if [ $? != 0 ] diff --git a/bin/ak-ipns-resolve b/bin/ak-ipns-resolve index 7f3839c..0dc7697 100755 --- a/bin/ak-ipns-resolve +++ b/bin/ak-ipns-resolve @@ -8,7 +8,7 @@ usage(){ echo "" echo "Returns the resolved IPFS CIDv0" } -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -z $1 ] then diff --git a/bin/ak-news b/bin/ak-news index fe7a003..5ccc3a9 100755 --- a/bin/ak-news +++ b/bin/ak-news @@ -5,7 +5,7 @@ descriptionString="Module to read, create and add zblocks" ZNEWSDIR="$AK_WORKDIR/news" TEMP="/tmp/aktmp" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d $ZNEWSDIR ]; then mkdir $ZNEWSDIR diff --git a/bin/ak-profile b/bin/ak-profile index 7499b88..7633c57 100755 --- a/bin/ak-profile +++ b/bin/ak-profile @@ -4,7 +4,7 @@ ZPROFILEDIR="$AK_WORKDIR/profile" TEMP="/tmp/aktmp" # Outputs to log file in the classic format :) -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit # Whatever the command is, we check if $ZPROFILEDIR is there. # If NOT we create it and we change dir there. diff --git a/bin/ak-schain-latest-cached b/bin/ak-schain-latest-cached index 87d9194..031e997 100755 --- a/bin/ak-schain-latest-cached +++ b/bin/ak-schain-latest-cached @@ -1,7 +1,7 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -f $AK_WORKDIR/schain.latest ] then ak-find-latest-mined-sblock > $AK_WORKDIR/schain.latest diff --git a/bin/ak-sm-files b/bin/ak-sm-files index e4815d0..6c0565b 100755 --- a/bin/ak-sm-files +++ b/bin/ak-sm-files @@ -5,7 +5,7 @@ CRD=$(cat .pwd) PROGRAM="$(basename $0)" #set -xe -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d $ZFILESDIR ]; then mkdir $ZFILESDIR diff --git a/bin/ak-sm-filesplitter b/bin/ak-sm-filesplitter index e121f32..b29ac59 100755 --- a/bin/ak-sm-filesplitter +++ b/bin/ak-sm-filesplitter @@ -41,7 +41,7 @@ TECHDIR="/tmp/tltmp/chks/" CURRENTDIR="$(pwd)/" # Our snippet for logging debug info -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit # Checking directories and create them if necessary diff --git a/bin/ak-stellar-get-participants b/bin/ak-stellar-get-participants index 11ea008..2a0aad7 100755 --- a/bin/ak-stellar-get-participants +++ b/bin/ak-stellar-get-participants @@ -3,7 +3,7 @@ PROGRAM="$(basename $0)" tempdir=`mktemp -d` tempfile="$tempdir/tmp" tempaddr="$tempdir/tmpaddr" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit stellarParticipants="$AK_WORKDIR/stellar-network-participants" stellarParticipantsOnline="$AK_WORKDIR/stellar-network-participants-online" diff --git a/bin/ak-tempassin b/bin/ak-tempassin index f2ac20c..11e534f 100755 --- a/bin/ak-tempassin +++ b/bin/ak-tempassin @@ -1,7 +1,7 @@ #!/bin/bash AK_TEMP="$(mktemp -d /tmp/aktmp-XXXXXXX)" PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d "$AK_TEMP" ] then diff --git a/bin/ak-todos b/bin/ak-todos index 8686836..2bd4ea1 100755 --- a/bin/ak-todos +++ b/bin/ak-todos @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit ZTODOSDIR="$AK_WORKDIR/todos" TEMP="/tmp/aktmp" diff --git a/bin/ak-transactions b/bin/ak-transactions index ec48853..f7024ef 100755 --- a/bin/ak-transactions +++ b/bin/ak-transactions @@ -4,7 +4,7 @@ _ak_modules_transactions_usage(){ echo "$PROGRAM from to amount" } -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit _ak_modules_transactions_main(){ logit "INFO" "$FROM_ADDRESS to $TO_ADDRESS value sent: $AMOUNT" diff --git a/bin/ak-zblock-cache b/bin/ak-zblock-cache index ed25f23..c314d56 100755 --- a/bin/ak-zblock-cache +++ b/bin/ak-zblock-cache @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit if [ ! -d "$AK_CACHEDIR/fzblocks" ] then diff --git a/bin/ak-zblock-manipulator b/bin/ak-zblock-manipulator index 8f83137..99583fa 100755 --- a/bin/ak-zblock-manipulator +++ b/bin/ak-zblock-manipulator @@ -16,7 +16,7 @@ # Below, the usage information PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit usage(){ echo "Usage:" diff --git a/bin/ak-zblock-pack b/bin/ak-zblock-pack index 9dd8c53..2a7c072 100755 --- a/bin/ak-zblock-pack +++ b/bin/ak-zblock-pack @@ -18,7 +18,7 @@ PROGRAM="$(basename $0)" set -xe # Logging patch -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit # Below, the usage information usage(){ diff --git a/bin/ak-zblock-show b/bin/ak-zblock-show index b828726..4cbe02e 100755 --- a/bin/ak-zblock-show +++ b/bin/ak-zblock-show @@ -7,7 +7,7 @@ PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit usage(){ echo "$PROGRAM - Show a zblock" diff --git a/bin/ak-zchain-chk b/bin/ak-zchain-chk index f6cdd11..02d8252 100755 --- a/bin/ak-zchain-chk +++ b/bin/ak-zchain-chk @@ -1,6 +1,6 @@ #!/bin/bash PROGRAM="$(basename $0)" -source $AK_LIBDIR/logit +source $AK_LIBDIR/_ak_logit fix="0" usage(){ diff --git a/lib/logit b/lib/_ak_logit index c6e1b51..c6e1b51 100755 --- a/lib/logit +++ b/lib/_ak_logit |