aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-follow
blob: e0e73365b283a2800848fd6d8f830ce324a1dfc1 (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
#!/bin/bash
FOLLOWING="$HOME/.arching-kaos/following"
PROGRAM="$(basename $0)"
source $AK_LIBDIR/_ak_logit

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