# ipupdate -rw-r--r-- 264 bytes View raw
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh
# ipupdate -- update a file on IPFS and remove the old version
# (requires kubo/go-ipfs and a POSIX shell)
#
# usage: ipupdate <dir>
#
set -xe

NEW_HASH=$(ipfs add -Q -r $@)
OLD_HASH=$(ipfs name resolve)
ipfs name publish $NEW_HASH
ipfs pin rm $OLD_HASH