aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-follow
blob: c289b0ff9c01ef523a7f5a70e9c461ba5aa89182 (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)"
source $AK_LIBDIR/_ak_log
source $AK_LIBDIR/_ak_ipfs

if [ ! -z $1 ]
then
    grep $1 $FOLLOWING
    if [ $? == 0 ]
    then
        _ak_log_error "Already exists"
        exit 1
    fi
    echo $1 >> $FOLLOWING
    IPFS=$(_ak_ipfs_add $FOLLOWING)
    if [ $? != 0 ]
    then
        _ak_log_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