Should help installation... plese try and report issue or make it better

This commit is contained in:
fred 2023-03-12 15:42:23 +01:00
parent fa16a218d9
commit 1fb8aedb1d
2 changed files with 61 additions and 0 deletions

22
install.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
echo "#############################################"
echo ">>>>>>>>>>> SYSTEMD SETUP "
echo "#############################################"
sudo apt install python3 python3-pip imagemagick qrencode ttf-mscorefonts-installer netcat-traditional
sudo pip3 install duniterpy
echo "# Correction des droits export PDF imagemagick"
if [[ $(cat /etc/ImageMagick-6/policy.xml | grep PDF) ]]; then
cat /etc/ImageMagick-6/policy.xml | grep -Ev PDF > /tmp/policy.xml
sudo cp /tmp/policy.xml /etc/ImageMagick-6/policy.xml
fi

39
systemd_setup.sh Executable file
View File

@ -0,0 +1,39 @@
#!/bin/bash
################################################################################
# Author: Fred (support@qo-op.com)
# Version: 0.1
# License: AGPL-3.0 (https://choosealicense.com/licenses/agpl-3.0/)
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
ME="${0##*/}"
echo "#############################################"
echo ">>>>>>>>>>> SYSTEMD SETUP "
echo "#############################################"
echo "CREATE SYSTEMD g1billet SERVICE >>>>>>>>>>>>>>>>>>"
cat > /tmp/g1billet.service <<EOF
[Unit]
Description=G1BILLET API
After=network.target
Requires=network.target
[Service]
Type=simple
User=_USER_
RestartSec=1
Restart=always
ExecStart=/home/_USER_/.zen/G1BILLET/G1BILLETS.sh daemon
StandardOutput=file:/home/_USER_/.zen/tmp/g1billet.log
[Install]
WantedBy=multi-user.target
EOF
sudo cp -f /tmp/g1billet.service /etc/systemd/system/
sudo sed -i "s/_USER_/$USER/g" /etc/systemd/system/g1billet.service
sudo systemctl daemon-reload
sudo systemctl enable g1billet
sudo systemctl restart g1billet