From 0ec8613d2742c5166994cc10f2c47cea957dc058 Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Thu, 10 Apr 2025 15:57:56 -0700 Subject: [PATCH] Update install.sh issues raised https://github.com/SpudGunMan/meshing-around/issues/139 --- install.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index 918f050..e757f8b 100755 --- a/install.sh +++ b/install.sh @@ -193,17 +193,19 @@ if [[ $(echo "${meshbotservice}" | grep -i "^y") ]] || [[ $(echo "${embedded}" | sudo usermod -a -G meshbot meshbot whoami="meshbot" echo "Added user meshbot with no home directory" - sudo usermod -a -G dialout $whoami - sudo usermod -a -G tty $whoami - sudo usermod -a -G bluetooth $whoami - echo "Added meshbot to dialout, tty, and bluetooth groups" - - sudo chown -R $whoami:$whoami $program_path/logs - sudo chown -R $whoami:$whoami $program_path/data - echo "Permissions set for meshbot on logs and data directories" else whoami=$(whoami) fi +# set basic permissions for the bot user +sudo usermod -a -G dialout $whoami +sudo usermod -a -G tty $whoami +sudo usermod -a -G bluetooth $whoami +echo "Added user $whoami to dialout, tty, and bluetooth groups" + +sudo chown -R $whoami:$whoami $program_path/logs +sudo chown -R $whoami:$whoami $program_path/data +echo "Permissions set for meshbot on logs and data directories" + # set the correct user in the service file replace="s|User=pi|User=$whoami|g" sed -i $replace etc/pong_bot.service