2017-04-21 04:57:03 +00:00
|
|
|
#!/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*)
|
|
|
|
:
|
|
|
|
;;
|
2017-04-22 08:23:06 +00:00
|
|
|
9*)
|
|
|
|
:
|
|
|
|
;;
|
2017-04-21 04:57:03 +00:00
|
|
|
*)
|
|
|
|
echo "Unsupported version $os_version of $os." >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
2017-04-23 06:16:43 +00:00
|
|
|
nextcloud_version=$(cat "$__object/parameter/version")
|
|
|
|
if [ ! "${nextcloud_version}" ]
|
|
|
|
then
|
|
|
|
echo "Missing nextcloud version (parameter/version)" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2017-04-25 09:42:03 +00:00
|
|
|
# TODO check if url parameter is set
|
|
|
|
nextcloud_uri="https://download.nextcloud.com/server/releases/nextcloud-${nextcloud_version}.tar.bz2"
|
|
|
|
# TODO check shasum of tar ball
|
|
|
|
cat <<eof
|
|
|
|
curl -s -L ${nextcloud_uri} -o /tmp/nextcloud.tar.bz2
|
2017-04-25 06:21:08 +00:00
|
|
|
tar -C /var/www -xvjf /tmp/nextcloud.tar.bz2
|
2017-04-25 09:42:03 +00:00
|
|
|
rm -f /tmp/nextcloud.tar.bz2
|
|
|
|
eof
|