Browse Source

nextcloud script

David Marec 9 months ago
parent
commit
2de22c5693
1 changed files with 52 additions and 0 deletions
  1. 52 0
      llanura/nextcloud.sh

+ 52 - 0
llanura/nextcloud.sh

@@ -0,0 +1,52 @@
+#!/bin/sh
+
+set -e
+
+go_start()
+{
+	/usr/sbin/service redis onestart
+	/usr/sbin/service nginx onestart
+	/usr/sbin/jail -c next
+}
+
+go_stop()
+{
+	/usr/sbin/service redis onestop
+	/usr/sbin/service nginx onestop
+	/usr/sbin/jail -r mariadb
+}
+
+pkgall()
+{
+	JAIL=""
+	[ -n "${1}" ] && JAIL="-c /jails/${1}"
+
+	pkg ${JAIL} upgrade
+	pkg ${JAIL} clean -a
+	pkg ${JAIL} autoremove
+}
+
+go_pkg()
+{
+	pkgall mariadb
+	pkgall next
+}
+
+case ${1} in
+	start)
+		go_start
+		;;
+	stop)
+		go_stop
+		;;
+	pkg)
+		go_pkg
+		;;
+	*)
+		>&2 echo "Usage ${0} [start|stop|pkg]"
+		exit 1
+		;;
+esac
+
+exit 0
+