Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-03-29 19:33:55 +0300
committernachoparker <nacho@ownyourbits.com>2017-03-31 18:42:32 +0300
commit75b42680feb34185107c6ebeae6162ec26f07f48 (patch)
treedb1b1dd3d200ecbfd74df60827f268685cfe218e /bin
parent7aa9c1c0910901b4f93b5307a3c42e1e340f2aef (diff)
ncp updates and motd. structure directoriesv0.1.0
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nextcloudpi-config62
1 files changed, 62 insertions, 0 deletions
diff --git a/bin/nextcloudpi-config b/bin/nextcloudpi-config
new file mode 100755
index 00000000..f4cb7a70
--- /dev/null
+++ b/bin/nextcloudpi-config
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# NextCloudPi software configuration
+# Tested with 2017-03-02-raspbian-jessie-lite.img
+#
+# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
+# GPL licensed (see end of file) * Use at your own risk!
+#
+# Usage:
+# sudo nextcloudpi-config
+#
+# More at https://ownyourbits.com/2017/03/13/nextcloudpi-gets-nextcloudpi-config/
+#
+
+CONFDIR=/usr/local/etc/nextcloudpi-config.d/
+
+source /usr/local/etc/library.sh
+
+function nextcloud-config()
+{
+ local DIALOG_OK=0
+ local LIST=()
+ for item in $CONFDIR/*.sh; do
+ local DESC=$( grep "DESCRIPTION=" $item | sed 's|^DESCRIPTION="||;s|"$||' )
+ LIST+=( $( basename $item .sh ) "$DESC" )
+ done
+ local script
+ script=$( whiptail --backtitle "NextCloudPi configuration" \
+ --title "NextCloudPi Software Configuration Tool (nextcloudpi-config)" \
+ --cancel-button Finish --ok-button Select \
+ --menu "Select program to configure and activate:" 20 100 10 \
+ "${LIST[@]}" \
+ 3>&1 1>&2 2>&3 )
+
+ [[ $? -ne $DIALOG_OK ]] || [[ "$script" == "" ]] && return 0
+
+ configure_script $script.sh
+}
+
+if [ $(id -u) -ne 0 ]; then
+ printf "Must be run as root. Try 'sudo $0'\n"
+ exit 1
+fi
+
+nextcloud-config
+
+# License
+#
+# This script is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This script is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this script; if not, write to the
+# Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+# Boston, MA 02111-1307 USA