Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.1 kB
2
Indexable
Never
#!/bin/bash
set -x
sudo systemctl disable monkd.service
sudo pkill -9 monkd
sudo systemctl stop monkd.service
sudo systemctl enable monkd.service

sudo podman container stop -a
for i in $(sudo podman ps -a | grep -v ^CONTAINER | awk '{print $1}'); do sudo podman kill "${i}"; done
for i in $(sudo podman ps -a | grep -v ^CONTAINER | awk '{print $1}'); do sudo podman rm "${i}"; done
sudo podman volume prune -f
sudo podman container prune -f
sudo podman system reset -f

sudo rm -rf /var/lib/monkd/ ~torin/.monk/ /root/.monk/ /usr/share/containers/storage.conf ~torin/.config/cni /var/lib/cni ~torin/.local/share/containers ~torin/.config/containers

sleep 5

sudo mkdir /var/lib/monkd/
sudo chmod 777 /var/lib/monkd/

sudo journalctl --rotate -u monkd
sudo journalctl --vacuum-time=1s -u monkd

sudo cp ./monkd.service /lib/systemd/system/monkd.service
sudo systemctl daemon-reload

sudo systemctl start monkd
while :; do
  if [ -e /var/lib/monkd/monkd.sock ]; then
    break
  fi
  sleep 5
done

sudo chmod 777 /var/lib/monkd/monkd.sock
monk login -l "$L" -p "$P"
monk cluster new -n klasterix
monk cluster provider add -p aws
monk version