aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-unfollow
blob: 07940f91912eb89f5d8acf30676077989dd5cad2 (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
27
28
#!/bin/bash
PROGRAM="$(basename $0)"
FOLLOWING="$HOME/.arching-kaos/following"
fentries="$(cat $FOLLOWING)"
if [ ! -z $1 ]
then
    search="$1"
    sed -i -e 's,'"$search"',,g' $FOLLOWING
    if [ $? != 0 ]
    then
        ak-logthis "$PROGRAM" "ERROR" "sed didn't found $search"
        exit 1
    fi
    IPFS="$(ak-ipfs-add $FOLLOWING)"
    if [ $? != 0 ]
    then
        ak-logthis "$PROGRAM" "ERROR" "IPFS problem"
        exit 1
    fi
    ak-profile set repositories "$IPFS"
    exit 0
else
    echo "Who to unfollow?"
    echo "Type following to see them"
    exit 1
fi