diff --git a/scripts/dist/install-tensorflow.sh b/scripts/dist/install-tensorflow.sh index 8e5251437..8bb2fe831 100755 --- a/scripts/dist/install-tensorflow.sh +++ b/scripts/dist/install-tensorflow.sh @@ -24,7 +24,7 @@ if [[ $(id -u) != "0" ]] && [[ $DESTDIR == "/usr" || $DESTDIR == "/usr/local" ]] exit 1 fi -/bin/mkdir -p "$DESTDIR" +mkdir -p "$DESTDIR" if [[ $TF_DRIVER == "auto" ]]; then echo "Detecting driver..." diff --git a/scripts/download-facenet.sh b/scripts/download-facenet.sh index b2a9887ed..71fcff424 100755 --- a/scripts/download-facenet.sh +++ b/scripts/download-facenet.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -TODAY=$(/bin/date -u +%Y%m%d) +TODAY=$(date -u +%Y%m%d) MODEL_NAME="Facenet" MODEL_URL="https://dl.photoprism.app/tensorflow/facenet.zip?$TODAY" @@ -13,11 +13,11 @@ MODEL_BACKUP="storage/backup/facenet-$TODAY" echo "Installing $MODEL_NAME model for TensorFlow..." # Create directories -/bin/mkdir -p /tmp/photoprism -/bin/mkdir -p storage/backup +mkdir -p /tmp/photoprism +mkdir -p storage/backup # Check for update -if [[ -f ${MODEL_ZIP} ]] && [[ $(/usr/bin/sha1sum ${MODEL_ZIP}) == ${MODEL_HASH} ]]; then +if [[ -f ${MODEL_ZIP} ]] && [[ $(sha1sum ${MODEL_ZIP}) == ${MODEL_HASH} ]]; then if [[ -f ${MODEL_VERSION} ]]; then echo "Already up to date." exit @@ -25,9 +25,9 @@ if [[ -f ${MODEL_ZIP} ]] && [[ $(/usr/bin/sha1sum ${MODEL_ZIP}) == ${MODEL_HASH} else # Download model echo "Downloading latest model from $MODEL_URL..." - /usr/bin/wget ${MODEL_URL} -O ${MODEL_ZIP} + wget ${MODEL_URL} -O ${MODEL_ZIP} - TMP_HASH=$(/usr/bin/sha1sum ${MODEL_ZIP}) + TMP_HASH=$(sha1sum ${MODEL_ZIP}) echo "${TMP_HASH}" fi @@ -35,12 +35,12 @@ fi # Create backup if [[ -e ${MODEL_PATH} ]]; then echo "Creating backup of existing directory: $MODEL_BACKUP" - /bin/rm -rf "${MODEL_BACKUP}" - /bin/mv ${MODEL_PATH} "${MODEL_BACKUP}" + rm -rf "${MODEL_BACKUP}" + mv ${MODEL_PATH} "${MODEL_BACKUP}" fi # Unzip model -/usr/bin/unzip ${MODEL_ZIP} -d assets +unzip ${MODEL_ZIP} -d assets echo "$MODEL_NAME $TODAY $MODEL_HASH" > ${MODEL_VERSION} echo "Latest $MODEL_NAME installed." diff --git a/scripts/download-nasnet.sh b/scripts/download-nasnet.sh index 9e0dcc7e2..b8802311e 100755 --- a/scripts/download-nasnet.sh +++ b/scripts/download-nasnet.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -TODAY=$(/bin/date -u +%Y%m%d) +TODAY=$(date -u +%Y%m%d) MODEL_NAME="NASNet Mobile" MODEL_URL="https://dl.photoprism.app/tensorflow/nasnet.zip?$TODAY" @@ -13,11 +13,11 @@ MODEL_BACKUP="storage/backup/nasnet-$TODAY" echo "Installing $MODEL_NAME model for TensorFlow..." # Create directories -/bin/mkdir -p /tmp/photoprism -/bin/mkdir -p storage/backup +mkdir -p /tmp/photoprism +mkdir -p storage/backup # Check for update -if [[ -f ${MODEL_ZIP} ]] && [[ $(/usr/bin/sha1sum ${MODEL_ZIP}) == "${MODEL_HASH}" ]]; then +if [[ -f ${MODEL_ZIP} ]] && [[ $(sha1sum ${MODEL_ZIP}) == "${MODEL_HASH}" ]]; then if [[ -f ${MODEL_VERSION} ]]; then echo "Already up to date." exit @@ -25,9 +25,9 @@ if [[ -f ${MODEL_ZIP} ]] && [[ $(/usr/bin/sha1sum ${MODEL_ZIP}) == "${MODEL_HASH else # Download model echo "Downloading latest model from $MODEL_URL..." - /usr/bin/wget "${MODEL_URL}" -O ${MODEL_ZIP} + wget "${MODEL_URL}" -O ${MODEL_ZIP} - TMP_HASH=$(/usr/bin/sha1sum ${MODEL_ZIP}) + TMP_HASH=$(sha1sum ${MODEL_ZIP}) echo "${TMP_HASH}" fi @@ -35,12 +35,12 @@ fi # Create backup if [[ -e ${MODEL_PATH} ]]; then echo "Creating backup of existing directory: $MODEL_BACKUP" - /bin/rm -rf "${MODEL_BACKUP}" - /bin/mv ${MODEL_PATH} "${MODEL_BACKUP}" + rm -rf "${MODEL_BACKUP}" + mv ${MODEL_PATH} "${MODEL_BACKUP}" fi # Unzip model -/usr/bin/unzip ${MODEL_ZIP} -d assets +unzip ${MODEL_ZIP} -d assets echo "$MODEL_NAME $TODAY $MODEL_HASH" > ${MODEL_VERSION} echo "Latest $MODEL_NAME installed." diff --git a/scripts/download-nsfw.sh b/scripts/download-nsfw.sh index 52ee09327..f1f5bdbd0 100755 --- a/scripts/download-nsfw.sh +++ b/scripts/download-nsfw.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -TODAY=$(/bin/date -u +%Y%m%d) +TODAY=$(date -u +%Y%m%d) MODEL_NAME="NSFW" MODEL_URL="https://dl.photoprism.app/tensorflow/nsfw.zip?$TODAY" @@ -13,11 +13,11 @@ MODEL_BACKUP="storage/backup/nsfw-$TODAY" echo "Installing $MODEL_NAME model for TensorFlow..." # Create directories -/bin/mkdir -p /tmp/photoprism -/bin/mkdir -p storage/backup +mkdir -p /tmp/photoprism +mkdir -p storage/backup # Check for update -if [[ -f ${MODEL_ZIP} ]] && [[ $(/usr/bin/sha1sum ${MODEL_ZIP}) == "${MODEL_HASH}" ]]; then +if [[ -f ${MODEL_ZIP} ]] && [[ $(sha1sum ${MODEL_ZIP}) == "${MODEL_HASH}" ]]; then if [[ -f ${MODEL_VERSION} ]]; then echo "Already up to date." exit @@ -25,9 +25,9 @@ if [[ -f ${MODEL_ZIP} ]] && [[ $(/usr/bin/sha1sum ${MODEL_ZIP}) == "${MODEL_HASH else # Download model echo "Downloading latest model from $MODEL_URL..." - /usr/bin/wget "${MODEL_URL}" -O ${MODEL_ZIP} + wget "${MODEL_URL}" -O ${MODEL_ZIP} - TMP_HASH=$(/usr/bin/sha1sum ${MODEL_ZIP}) + TMP_HASH=$(sha1sum ${MODEL_ZIP}) echo ${TMP_HASH} fi @@ -35,12 +35,12 @@ fi # Create backup if [[ -e ${MODEL_PATH} ]]; then echo "Creating backup of existing directory: $MODEL_BACKUP" - /bin/rm -rf "${MODEL_BACKUP}" - /bin/mv ${MODEL_PATH} "${MODEL_BACKUP}" + rm -rf "${MODEL_BACKUP}" + mv ${MODEL_PATH} "${MODEL_BACKUP}" fi # Unzip model -/usr/bin/unzip ${MODEL_ZIP} -d assets +unzip ${MODEL_ZIP} -d assets echo "$MODEL_NAME $TODAY $MODEL_HASH" > ${MODEL_VERSION} echo "Latest $MODEL_NAME installed."