Skip to content

Commit

Permalink
adjust owner instead of setting full permissions for json files
Browse files Browse the repository at this point in the history
  • Loading branch information
tanhongit committed Feb 25, 2024
1 parent 7e13e52 commit 53166b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ for file in "${json_files[@]}"; do
done

if [[ "$(uname -s -r)" == *"Linux"* && "$(cat /etc/os-release)" == *"Ubuntu"* ]]; then
chmod 777 storage/json/tgn/*.json
# shellcheck disable=SC2196
OWNER=$(ps aux | egrep '(apache|httpd|nginx)' | grep -v root | head -n1 | awk '{print $1}')
if [ -z "$OWNER" ]; then
OWNER=$(whoami)
fi
sudo chown -R "$OWNER":"$OWNER" storage/json/tgn
fi

echo "Telegram Git Notifier config files are ready!"

0 comments on commit 53166b2

Please sign in to comment.