diff --git a/mithril-install.sh b/mithril-install.sh index df830619561..cbdc0e0e7e8 100755 --- a/mithril-install.sh +++ b/mithril-install.sh @@ -95,14 +95,19 @@ esac # Set temp file TEMP_FILE="${INSTALL_PATH}/temp.json" -# Create the install path if it doesn't exist -mkdir -p "$INSTALL_PATH" - # Check if node and path are provided if [ -z "$NODE" ] || [ -z "$DISTRIBUTION" ] || [ -z "$INSTALL_PATH" ]; then usage fi +# Create the install path if it doesn't exist +mkdir -p "$INSTALL_PATH" + +# Check if install path is writable +if [ ! -w "$INSTALL_PATH" ]; then + error_exit "Error: The specified install path '$INSTALL_PATH' is not writable." +fi + # Validate node if [ "$NODE" != "mithril-signer" ] && [ "$NODE" != "mithril-aggregator" ] && [ "$NODE" != "mithril-client" ]; then echo "Invalid node: $NODE"