Skip to content

Commit 039015b

Browse files
hellodarknesscameri
authored andcommitted
Added directory check to start scripts (#252)
Fixes #218
1 parent e1561e7 commit 039015b

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

scripts/start

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml"
44
NOSTR_CONFIG_DIR="${PROJECT_ROOT}/.nostr"
55
SETTINGS_FILE="${NOSTR_CONFIG_DIR}/settings.yaml"
66
DEFAULT_SETTINGS_FILE="${PROJECT_ROOT}/resources/default-settings.yaml"
7+
CURRENT_DIR=$(pwd)
8+
9+
if [[ ${CURRENT_DIR} =~ /scripts$ ]]; then
10+
echo "Please run this script from the Nostream root folder, not the scripts directory."
11+
echo "To do this, change up one directory, and then run the following command:"
12+
echo "./scripts/start"
13+
exit 1
14+
fi
15+
716

817
if [ "$EUID" -eq 0 ]
918
then echo "Error: Nostream should not be run as root."

scripts/start_local

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ set -e
44
PROJECT_ROOT="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))/.."
55
DOCKER_COMPOSE_FILE="${PROJECT_ROOT}/docker-compose.yml"
66
DOCKER_COMPOSE_LOCAL_FILE="${PROJECT_ROOT}/docker-compose.local.yml"
7+
CURRENT_DIR=$(pwd)
8+
9+
if [[ ${CURRENT_DIR} =~ /scripts$ ]]; then
10+
echo "Please run this script from the Nostream root folder, not the scripts directory."
11+
echo "To do this, change up one directory, and then run the following command:"
12+
echo "./scripts/start"
13+
exit 1
14+
fi
715

816
if [ "$EUID" -eq 0 ]
917
then echo "Error: Nostream should not be run as root."

scripts/start_with_tor

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ TOR_DATA_DIR="$PROJECT_ROOT/.nostr/tor/data"
66
NOSTR_CONFIG_DIR="${PROJECT_ROOT}/.nostr"
77
SETTINGS_FILE="${NOSTR_CONFIG_DIR}/settings.yaml"
88
DEFAULT_SETTINGS_FILE="${PROJECT_ROOT}/resources/default-settings.yaml"
9+
CURRENT_DIR=$(pwd)
10+
11+
if [[ ${CURRENT_DIR} =~ /scripts$ ]]; then
12+
echo "Please run this script from the Nostream root folder, not the scripts directory."
13+
echo "To do this, change up one directory, and then run the following command:"
14+
echo "./scripts/start"
15+
exit 1
16+
fi
917

1018
if [ "$EUID" -eq 0 ]
1119
then echo "Error: Nostream should not be run as root."

0 commit comments

Comments
 (0)