aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-follow
blob: a4ca0702b13777b7e0927921799490a6f85733f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
FOLLOWING="$HOME/.arching-kaos/following"
PROGRAM="$(basename $0)"
logit(){
    ak-logthis "$PROGRAM" "$1" "$2"
}
if [ ! -z $1 ]
then
    grep $1 $FOLLOWING
    if [ $? == 0 ]
    then
        logit "ERROR" "Already exists"
        exit 1
    fi
    echo $1 >> $FOLLOWING
    IPFS=$(ak-ipfs-add $FOLLOWING)
    if [ $? != 0 ]
    then
        logit "ERROR" "Addition failed"
        exit 1
    fi
    ak-profile set following $IPFS
    exit 0
fi
printf "Usage:\n\t%s <AKID_IPFS_CID_v0>\n" $PROGRAM
exit 1