#!/bin/bash

sudo systemctl stop wire-pod

cd ~/wire-pod

sudo ./update.sh

#Fix Wifi AP
sed -i 's/return net.IPv4(0, 0, 0, 0)/return net.IPv4(192, 168, 5, 1)/g' /root/wire-pod/chipper/pkg/vars/vars.go

#sudo USE_INBUILT_BLE=true ./setup.sh daemon-enable
sudo ./setup.sh daemon-enable

wget -O - https://raw.githubusercontent.com/bliteknight/wire-pod-plugins/main/install_all.sh | bash

sudo systemctl start wire-pod

#Set version
#LATEST_VERSION=$(curl  "https://api.github.com/repos/kercre123/wire-pod/tags" | jq -r '.[0].name')
#"https://api.github.com/repos/kercre123/WirePod/releases/latest
LATEST_VERSION=$(date +%Y-%m-%d)
echo "Built From Source on $LATEST_VERSION">~/wire-pod/chipper/version

echo "All Done!"


