#!/bin/bash -i titled() { echo "basepath=$basepath"; echo "1=IPFS_PATH=$IPFS_PATH" echo "2=text=$text"; echo "3=index=$index"; echo "4=h1=$h1"; echo "5=h1t=$h1t"; echo 'hs1s; hs1; utc; mkdir "$h1t/"; utc; mv -n "$h1" "$h1t/"; utc'; hs1s; hs1; utc; mkdir "$h1t/"; utc; mv -n "$h1" "$h1t/"; utc; } IPFS_PATH=$1 #/z8/b/ipfs/.ipfs text=$2 #$HOME/Downloads/add/1/datetime.txt basepath=$(echo $2 | sed "s/\/datetime.txt$//g") index=$3 #/z8/b/ipfs/cid.txt h1=$4 #/path/to/image/file.png h1t=$5 #$HOME/Downloads/add/1/Title_of_image_file titled > "$text"; text1=$(ipfs add -rHQ "$basepath"); added=added_$(date +%s); text0=$(echo "$h1t" | sed "s/.*\///g"); echo >> "$index"; echo $text0 >> "$index"; echo "$text1" >> "$index"; echo "- $added" >> "$index"; rmlater="$basepath/../$added"; mkdir "$rmlater"; mv -n "$h1t" "$rmlater"; mv -n "$text" "$rmlater"; echo "$text1/"; ipfs ls "$text1"; echo "$text0/"; ipfs ls "$text1/$text0"