Changed ownership of /opt/TC2-BBS-mesh

This commit is contained in:
nagumii 2025-01-07 17:44:44 +02:00
parent 84b99133b2
commit 65eda7c508

View file

@ -64,7 +64,6 @@ meshing_around() { # Install Meshing Around
tc2_bbs() { # Install TC²BBS
failedInstall=false
dialog --title "$software" --yesno "The TC²-BBS system integrates with Meshtastic devices. The system allows for message handling, bulletin boards, mail systems, and a channel directory.\nInstallation requires internet connection.\n\nLearn more at https://github.com/TheCommsChannel/TC2-BBS-mesh\nIf software is already present, will attempt to update.\n\nInstall?" 0 0
if [ ! -d /opt/TC2-BBS-mesh ]; then
if [ $? -eq 0 ]; then #unless cancel/no
@ -85,6 +84,8 @@ tc2_bbs() { # Install TC²BBS
fi
if [ ! -f /opt/TC2-BBS-mesh/config.ini ]; then # if the config file doesn't exist but the clone was successful, then we need to do some configuring and rejiggering
cd /opt/TC2-BBS-mesh
chown -R femto /opt/TC2-BBS-mesh
git config --global --add safe.directory /opt/TC2-BBS-mesh # prevents git error when updating
echo "Creating virtual environment. This can take a couple minutes."
python3 -m venv venv
source venv/bin/activate
@ -95,6 +96,7 @@ tc2_bbs() { # Install TC²BBS
fi
dialog --title "$software" --yesno "Installation/upgrade successful! \n\nInstall service?\n\nIn Linux, services automatically start on boot and restart if the software stops for any reason." 0 0
if [ $? -eq 0 ]; then #unless cancel/no
cd /opt/TC2-BBS-mesh
source venv/bin/activate
sed -i "s/pi/${SUDO_USER:-$(whoami)}/g" mesh-bbs.service
sed -i "s|/home/femto/|/opt/|g" mesh-bbs.service