Skip to content

Instantly share code, notes, and snippets.

@billerby
Created September 27, 2017 06:32
Show Gist options
  • Save billerby/1e082b371c8dd532e3b987796b8de101 to your computer and use it in GitHub Desktop.
Save billerby/1e082b371c8dd532e3b987796b8de101 to your computer and use it in GitHub Desktop.
Post files to filebin
#!/bin/bash
#
# Upload files to a named filebin installation
# (https://github.com/espebra/filebin)
#
# Usage:
# Set the correct environments variables below and run.
#
# Author: billerby@gmail.com
export ALFRESCO_WAR_PATH=../tomcat-repo/webapps
export ALFRESCO_WAR_SHA256=`sha256sum $ALFRESCO_WAR_PATH/alfresco.war | awk '{ print $1}'`
export SHARE_WAR_PATH=../tomcat-share/webapps
export SHARE_WAR_SHA256=`sha256sum $SHARE_WAR_PATH/share.war | awk '{ print $1}'`
export FILEBIN_NAME=lyse-release
export FILEBIN_URL=https://filebin.redpill-linpro.com
# First delete any existing bin with this name
curl -X DELETE $FILEBIN_URL/$FILEBIN_NAME
curl --data-binary @$ALFRESCO_WAR_PATH/alfresco.war $FILEBIN_URL/ -H "bin: $FILEBIN_NAME" -H "filename: alfresco.war" -H "content-sha256: $ALFRESCO_WAR_SHA256"
curl --data-binary @$SHARE_WAR_PATH/share.war $FILEBIN_URL/ -H "bin: $FILEBIN_NAME" -H "filename: share.war" -H "content-sha256: $SHARE_WAR_SHA256"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment