22 lines
1.1 KiB
Bash
22 lines
1.1 KiB
Bash
#!/bin/bash
|
|
|
|
## mirror
|
|
lxc-attach -n c_apt-mirror -- sudo -u apt-mirror -g apt-mirror apt-mirror
|
|
|
|
#ipfs check storage
|
|
lxc-attach -n c_ipfs -- /ipfs filestore verify
|
|
|
|
#ipfs key gen --type=rsa --size=2048 archive.canonical.com
|
|
# -> QmUajtQCL6yHcBaYxsZKyD8QH7n977ZVxjU5yMXwYC183c
|
|
hash_canonical="$(lxc-attach -n c_ipfs -- /ipfs add --progress --local --nocopy --fscache --recursive /srv/apt-mirror/archive.canonical.com/ubuntu/ | tail -n1)"
|
|
name_canonical="$(lxc-attach -n c_ipfs -- /ipfs name publish --key=archive.canonical.com `echo $hash_canonical | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)"
|
|
echo "archive.canonical.com/ubuntu -> $name_canonical"
|
|
echo 'done'
|
|
|
|
#ipfs key gen --type=rsa --size=2048 archive.ubuntu.com
|
|
# -> QmXfAyjHThwksUyW9BwuqCDuzu1PM1XQkR1HVTbActvYDJ
|
|
hash_ubuntu="$(lxc-attach -n c_ipfs -- /ipfs add --progress --local --nocopy --fscache --recursive /srv/apt-mirror/archive.ubuntu.com/ubuntu/ | tail -n1)"
|
|
name_ubuntu="$(lxc-attach -n c_ipfs -- /ipfs name publish --key=archive.ubuntu.com `echo $hash_ubuntu | cut -d ' ' -f 2` | cut -d ' ' -f 3 | tr -d :)"
|
|
echo "archive.utuntu.com/ubuntu -> $name_ubuntu"
|
|
echo 'done'
|