Make scripts work with sh

This commit is contained in:
Vinrobot 2019-07-06 01:08:37 +02:00
parent 1f71f2e54c
commit 3d20f0c591
No known key found for this signature in database
GPG Key ID: 20207D962D63DD48
4 changed files with 11 additions and 7 deletions

View File

@ -3,7 +3,8 @@
# Check for openssl # Check for openssl
command -v openssl >/dev/null 2>&1 || { echo >&2 "openssl required but not found. Aborting."; exit 1; } command -v openssl >/dev/null 2>&1 || { echo >&2 "openssl required but not found. Aborting."; exit 1; }
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DIR=`dirname "$0"`
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
# Remove any existing key files # Remove any existing key files
[ ! -e "$DIR/cert.pem" ] || rm "$DIR/cert.pem" [ ! -e "$DIR/cert.pem" ] || rm "$DIR/cert.pem"

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/sh
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DIR=`dirname "$0"`
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
# If there aren't any keys, generate them first. # If there aren't any keys, generate them first.
[ -e "$DIR/.keys/cert.cert" ] || "$DIR/.keys/generate-keys.sh" [ -e "$DIR/.keys/cert.cert" ] || "$DIR/.keys/generate-keys.sh"

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/sh
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" DIR=`dirname "$0"`
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
docker build -t bitbetter/licensegen "$DIR" # --squash docker build -t bitbetter/licensegen "$DIR" # --squash

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/sh
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && cd ../.. && pwd)" DIR=`dirname "$0"`
DIR=`exec 2>/dev/null;(cd -- "$DIR") && cd -- "$DIR"|| cd "$DIR"; unset PWD; /usr/bin/pwd || /bin/pwd || pwd`
# Grab the absolute path to the default pfx location # Grab the absolute path to the default pfx location
cert_path="$DIR/.keys/cert.pfx" cert_path="$DIR/.keys/cert.pfx"