aboutsummaryrefslogtreecommitdiff
path: root/bin/ak-unfollow
blob: c23aeef45c4a8f7c036418831f9239dced46e16f (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
29
30
#!/bin/bash
PROGRAM="$(basename $0)"
source $AK_LIBDIR/_ak_config
source $AK_LIBDIR/_ak_ipfs
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_log_error "sed didn't found $search"
        exit 1
    fi
    IPFS="$(_ak_ipfs_add $FOLLOWING)"
    if [ $? != 0 ]
    then
        _ak_log_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