aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-follow
blob: 0d6107c5114b9ceeb98a7367a6781b8e74078be3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
FOLLOWING="$HOME/.arching-kaos/following"
PROGRAM="$(basename $0)"
if [ ! -z $1 ]
then
    grep $1 $FOLLOWING
    if [ $? == 0 ]
    then
        ak-logthis "<$(basename $0)>" "[ERROR]" "Already exists"
        exit 1
    fi
    echo $1 >> $FOLLOWING
    IPFS=$(ak-ipfs-add $FOLLOWING)
    if [ $? != 0 ]
    then
        ak-logthis "<$PROGRAM>" "[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