Resolve "Mistborn and wireguard fail after restart and nextcloud"

This commit is contained in:
Steven Foerster
2020-08-24 01:54:02 +00:00
parent 585a78ac1b
commit c2143d278a
5 changed files with 34 additions and 23 deletions
+13
View File
@@ -1,5 +1,7 @@
#!/bin/bash
#### ENV file
VAR_FILE=/opt/mistborn/.env
source /opt/mistborn/scripts/subinstallers/platform.sh
@@ -19,3 +21,14 @@ if [ "$GIT_BRANCH" != "master" ]; then
fi
echo "MISTBORN_TAG=$MISTBORN_TAG" | sudo tee -a ${VAR_FILE}
#### install and base services
iface=$(ip -o -4 route show to default | egrep -o 'dev [^ ]*' | awk 'NR==1{print $2}')
# default interface
sudo cp /opt/mistborn/scripts/services/Mistborn* /etc/systemd/system/
sudo find /etc/systemd/system/ -type f -name 'Mistborn*' | xargs sudo sed -i "s/User=root/User=$USER/"
#sudo find /etc/systemd/system/ -type f -name 'Mistborn*' | xargs sudo sed -i "s/ root:root / $USER:$USER /"
sudo find /etc/systemd/system/ -type f -name 'Mistborn*' | xargs sudo sed -i "s/DIFACE/$iface/"
sudo systemctl daemon-reload