#!/usr/bin/with-contenv bash #################### # Pictures storage #################### if [ ! -d "/opt/pictures" ] ; then mkdir /opt/pictures fi #################### # Ansible #################### if [ ! -d "/opt/ansible" ] ; then mkdir /opt/ansible fi if [ ! -d "/opt/ansible/.git" ] ; then git clone https://git.kemonine.info/PiFrame/ansible.git /opt/ansible/ else cd /opt/ansible git pull fi if [ ! -f "/opt/ansible/ssh.key" ] ; then ssh-keygen -t rsa -b 4096 -f /opt/ansible/ssh.key -N '' echo " ------------------------------------- Ansible SSH Key" cat /opt/ansible/ssh.key.pub echo "------------------------------------- " fi #################### # WireGuard #################### if [ "$ENABLE_WIREGUARD" = true ] ; then ip link del dev test 2>/dev/null if ip link add dev test type wireguard; then echo "**** It seems the wireguard module is already active :) ****" ip link del dev test else echo "**** The wireguard module is not active, please install wireguard on the host and activate the 'wg' kernel module ****" fi if [ ! -d "/opt/wireguard" ] ; then mkdir /opt/wireguard fi fi #################### # syncthing #################### if [ "$ENABLE_SYNCTHING" = true ] ; then if [ ! -d "/opt/syncthing" ]; then mkdir /opt/syncthing fi ST_CONF="/opt/syncthing/config.xml" if [ ! -f "$ST_CONF" ]; then echo "**** Initial Syncthing Config ****" /usr/bin/syncthing -generate /opt/syncthing sed -i 's/
127.0.0.1:8384<\/address>/0.0.0.0:8384<\/address>/g' /opt/syncthing/config.xml sed -i 's/