__ungleich_nextcloud/gencode-remote
2017-04-23 08:28:55 +02:00

40 lines
1,003 B
Bash
Executable file

#!/bin/sh
os=$(cat "$__global/explorer/os")
if [ ! "$os" = "debian" ]
then
echo "OS $os is currently not supported." >&2
exit 1
fi
os_version=$(cat "$__global/explorer/os_version")
case "$os_version" in
8*)
:
;;
9*)
:
;;
*)
echo "Unsupported version $os_version of $os." >&2
exit 1
;;
esac
nextcloud_url=$(cat "$__object/parameter/url")
if [ ! "${nextcloud_url}" ]
then
echo "Missing nextcloud uri (parameter/url)" >&2
exit 1
fi
nextcloud_version=$(cat "$__object/parameter/version")
if [ ! "${nextcloud_version}" ]
then
echo "Missing nextcloud version (parameter/version)" >&2
exit 1
fi
nextcloud_uri="${nextcloud_url}-${nextcloud_version}.tar.bz2"
# Download tar ball extract and apply script
# TODO: verify shasum of tar ball
curl -LO ${nextcloud_uri} -o ${nextcloud_dir}/nextcloud.tar.bz2
tar -C /var/www -xvjf ${nextcloud_dir}/nextcloud.tar.bz2
rm ${nextcloud_dir}/nextcloud.tar.bz2
bash ${__type}/files/nextcloud.sh