#!/bin/bash # Run Gradle build ./gradlew build # Check if the build was successful if [ $? -eq 0 ]; then echo "Gradle build successful." # Obfuscate with Grunt cd ./obf/ java -jar grunt-1.5.7.jar cd .. echo "Obfuscation complete." # SFTP upload SFTP_HOST="192.168.1.199" SFTP_USER="trouper" SFTP_PASSWORD="Trouper12()1" SFTP_REMOTE_DIR="/home/trouper/docker/data/plugins/" # Specify the local file to upload LOCAL_FILE="./build/libs/UltraDupe-0.2.5.jar" # Create a temporary file with a unique name TEMP_FILE=$(mktemp) # Write the SFTP commands to the temporary file echo "put $LOCAL_FILE $SFTP_REMOTE_DIR" > "$TEMP_FILE" echo "bye" >> "$TEMP_FILE" # Use sftp non-interactively with the specified commands sftp -oStrictHostKeyChecking=no -oBatchMode=no -b "$TEMP_FILE" "$SFTP_USER@$SFTP_HOST" <