mirror of
https://github.com/casjaysdevdocker/nextcloud
synced 2025-09-18 03:57:53 -04:00
🗃️ Committing everything that changed 🗃️
bin/entrypoint-nextcloud.sh bin/.gitkeep bin/healthcheck bin/occ config/cont-init.d/00-fix-logs.sh config/cont-init.d/01-fix-uidgid.sh config/cont-init.d/02-fix-perms.sh config/cont-init.d/03-config.sh config/cont-init.d/04-svc-main.sh config/cont-init.d/05-svc-cron.sh config/cont-init.d/06-svc-previewgen.sh config/cont-init.d/07-svc-news-updater.sh config/.gitkeep config/php/conf.d/smbclient.ini config/tpls/bootstrap.php config/tpls/etc/nginx/nginx.conf config/tpls/etc/php/conf.d/apcu.ini config/tpls/etc/php/conf.d/opcache.ini config/tpls/etc/php/conf.d/override.ini config/tpls/etc/php/php-fpm.d/www.conf data/.gitkeep Dockerfile .env.scripts .gitattributes .gitignore rootfs/.gitkeep rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/bin/.gitkeep rootfs/usr/local/bin/next-cloud rootfs/usr/local/bin/occ rootfs/usr/local/bin/pkmgr rootfs/usr/local/bin/start-nextcloud.sh rootfs/usr/local/etc/ rootfs/usr/local/share/template-files/config/env/
This commit is contained in:
81
rootfs/usr/local/bin/next-cloud
Normal file
81
rootfs/usr/local/bin/next-cloud
Normal file
@@ -0,0 +1,81 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck shell=bash
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
##@Version : 202407071518-git
|
||||
# @@Author : Jason Hempstead
|
||||
# @@Contact : git-admin@casjaysdev.pro
|
||||
# @@License : LICENSE.md
|
||||
# @@ReadME : template --help
|
||||
# @@Copyright : Copyright: (c) 2024 Jason Hempstead, Casjays Developments
|
||||
# @@Created : Sunday, Jul 07, 2024 15:18 EDT
|
||||
# @@File : template
|
||||
# @@Description : newScript
|
||||
# @@Changelog : newScript
|
||||
# @@TODO : Refactor code
|
||||
# @@Other :
|
||||
# @@Resource :
|
||||
# @@Terminal App : no
|
||||
# @@sudo/root : no
|
||||
# @@Template : bash/system
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# shell check options
|
||||
# shellcheck disable=SC2317
|
||||
# shellcheck disable=SC2120
|
||||
# shellcheck disable=SC2155
|
||||
# shellcheck disable=SC2199
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
APPNAME="$(basename "$0")"
|
||||
VERSION="202407071518-git"
|
||||
HOME="${USER_HOME:-$HOME}"
|
||||
USER="${SUDO_USER:-$USER}"
|
||||
RUN_USER="${SUDO_USER:-$USER}"
|
||||
SRC_DIR="${BASH_SOURCE%/*}"
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Set bash options
|
||||
set -o pipefail
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Create functions
|
||||
__docker_run() {
|
||||
docker run \
|
||||
--init \
|
||||
--sig-proxy=false \
|
||||
--name nextcloud \
|
||||
--restart always \
|
||||
--publish 80:8080 \
|
||||
--env TALK_PORT=3478 \
|
||||
--env HOSTNAME=nextcloud \
|
||||
--env NEXTCLOUD_ADDITIONAL_APKS="imagemagick " \
|
||||
--env NEXTCLOUD_DATADIR="/data/nextcloud" \
|
||||
--volume /config/nextcloud:/mnt/docker-aio-config \
|
||||
--volume /var/run/docker.sock:/var/run/docker.sock:ro \
|
||||
nextcloud/all-in-one:latest
|
||||
return $?
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
__docker_cron() {
|
||||
local retVal=0
|
||||
[ -f "/run/nextcloud-cron.pid" ] && return || touch /run/nextcloud-cron.pid
|
||||
docker rm -f nextcloud && docker pull nextcloud/all-in-one:latest && __docker_run
|
||||
retval=$?
|
||||
rm -Rf /run/nextcloud-cron.pid
|
||||
return $retval
|
||||
}
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
# Create directories
|
||||
[ -d "/data/nextcloud" ] || mkdir -p /data/nextcloud
|
||||
[ -d "/config/nextcloud" ] || mkdir -p /config/nextcloud
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
case "$1" in
|
||||
cron)
|
||||
__docker_cron
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
(sleep 86400 && __docker_cron) &
|
||||
__docker_run &
|
||||
dockerPid=$!
|
||||
;;
|
||||
esac
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
wait -f $dockerPid
|
||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Reference in New Issue
Block a user