2020-10-24 07:05:22 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
# __nextcloud/explorer/version
|
|
|
|
|
|
|
|
# Check the currently installed version. Outputs nothing if nothing found.
|
|
|
|
|
|
|
|
|
|
|
|
# Get the install directory
|
|
|
|
installdir="$( "$__type_explorer/installdir" )"
|
|
|
|
|
|
|
|
# Check if the installation directory exists
|
|
|
|
if [ -d "$installdir" ]; then
|
|
|
|
cd "$installdir"
|
|
|
|
|
|
|
|
# if those files exist, everything should be good
|
|
|
|
if [ -f "occ" ] && [ -f "version.php" ]; then
|
2020-10-24 07:31:59 +00:00
|
|
|
# Detect php version with the version file.
|
|
|
|
# shellcheck disable=SC2016 # cause of the php inline code
|
2020-10-24 07:05:22 +00:00
|
|
|
php -r 'require("version.php"); print($OC_VersionString);'
|
|
|
|
fi
|
|
|
|
fi
|