Created
December 12, 2016 19:51
-
-
Save Voker57/5cc7abdb6f5e6f884d534e6d8d9ffac7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# dump.bitcheese.net backup script | |
# stores current dump backup id in BACKUP_ID_FILE because ipfs dos not allow ipns pinning yet | |
BACKUP_ID_FILE=$HOME/.dump-backup-is | |
BACKUP_ID="" | |
if [ -f "$BACKUP_ID_FILE" ] | |
then | |
BACKUP_ID=`cat $BACKUP_ID_FILE` | |
fi | |
NEW_BACKUP_ID=`ipfs name resolve /ipns/QmUVuK32prRah8FDuCv1Hoz8pSksX9yUwr49EcPkMKo9XE` | |
if [ "$NEW_BACKUP_ID" != "$BACKUP_ID" -a ! -z "$NEW_BACKUP_ID" ] | |
then | |
if [ ! -z "$BACKUP_ID" ] | |
then | |
ipfs pin rm "$BACKUP_ID" | |
fi | |
echo "$NEW_BACKUP_ID" > "$BACKUP_ID_FILE" | |
ipfs pin add "$NEW_BACKUP_ID" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment