blob: b6c5737b10dd480b2ad2d1a250877e8c751af7a2 (
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
31
32
33
34
35
36
37
|
post_install() {
echo ""
echo "Create user ipfs..."
sudo useradd -m ipfs
sudo usermod --shell /bin/bash ipfs
echo ""
echo "Initialize IPFS..."
sudo mkdir -p /opt/ipfs-repo
sudo chown ipfs:ipfs -R /opt/ipfs-repo
sudo su ipfs <<EOL
export IPFS_PATH=/opt/ipfs-repo
/usr/bin/ipfs init
EOL
post_upgrade $1 0
}
post_upgrade() {
echo ""
echo "Update Services..."
sudo systemctl daemon-reload
echo ""
echo "You can now use ipfs service with:"
echo "sudo systemctl start ipfs"
echo "sudo systemctl enable ipfs #to start ipfs on system startup"
echo ""
}
post_remove() {
echo ""
echo "Update Services..."
sudo systemctl daemon-reload
echo ""
echo "Default repository and user won't be deleted! You can do it manually with:"
echo "sudo rm -rf /opt/ipfs-repo/"
echo "sudo userdel -rf ipfs"
echo ""
}
|