Skip to content

Commit cdc4548

Browse files
authored
Merge pull request #2660 from input-output-hk/dlachaume/one-line-installer-install-path-writable
fix: add write access check for install path in one-line installer
2 parents a776b3d + 08d4683 commit cdc4548

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

mithril-install.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,19 @@ esac
9595
# Set temp file
9696
TEMP_FILE="${INSTALL_PATH}/temp.json"
9797

98-
# Create the install path if it doesn't exist
99-
mkdir -p "$INSTALL_PATH"
100-
10198
# Check if node and path are provided
10299
if [ -z "$NODE" ] || [ -z "$DISTRIBUTION" ] || [ -z "$INSTALL_PATH" ]; then
103100
usage
104101
fi
105102

103+
# Create the install path if it doesn't exist
104+
mkdir -p "$INSTALL_PATH"
105+
106+
# Check if install path is writable
107+
if [ ! -w "$INSTALL_PATH" ]; then
108+
error_exit "Error: The specified install path '$INSTALL_PATH' is not writable."
109+
fi
110+
106111
# Validate node
107112
if [ "$NODE" != "mithril-signer" ] && [ "$NODE" != "mithril-aggregator" ] && [ "$NODE" != "mithril-client" ]; then
108113
echo "Invalid node: $NODE"

0 commit comments

Comments
 (0)