Skip to content

Commit

Permalink
deploy: 115c52e
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 25, 2023
1 parent 72fbfc2 commit 6780d1c
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions healthcheck
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,23 @@ healthIssueCount=0
warningCount=0

# Utils
findHintInstallPath() {
getent passwd | while IFS=: read -r name password uid gid gecos home shell; do
if [[ -d "/home/$name/fleek-network/$defaultName" ]]; then
echo "⚠️ WARNING: Found the repository installed under username $name and path /home/$name/fleek-network/$defaultName. You should probably switch to user $name"
findInstallPath() {
data=$(cut -d : -f1 /etc/passwd)
currUser=$(whoami)

for name in $data; do
if [[ -d "/home/$name/fleek-network/lightning" && "$name" != "$currUser" ]]; then
echo "⚠️ WARNING: You are currently logged in as $currUser, but the respository was found in another username home (/home/$name/fleek-network/lightning)"
echo
echo "So, before proceeding, do the following steps:"
echo
echo "1) Switch to the username $name, e.g. su $name"
echo "2) Change directory to the user home, e.g. cd \$HOME"
echo
echo "Once done, run this script again!"
echo

exit 1
fi
done
}
Expand All @@ -59,6 +72,8 @@ healthIssueLog=""

exit 1
elif [[ "$answer" == [yY] || "$answer" == [yY][eE][sS] ]]; then
findInstallPath

break;
fi

Expand All @@ -85,8 +100,6 @@ healthIssueLog=""
if [[ ! -d "$basePath/fleek-network/$defaultName" ]]; then
warningLog+=$'\n'"⚠️ WARNING: The Fleek Network Lightning CLI source code wasn't found in $basePath/fleek-network/$defaultName. If you have installed the service with the username $(whoami) and haven't customised the path, the source code is not in the expected location"

findHintInstallPath

((warningCount++))
else
successLog+=$'\n'"✅ Found source code in $basePath/fleek-network/$defaultName"
Expand Down

0 comments on commit 6780d1c

Please sign in to comment.