mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-09 14:42:01 -03:30
check for empty directory nc-datadir.
make menu prettier
This commit is contained in:
parent
2a49453204
commit
6ed507a7f7
@ -17,7 +17,7 @@ DOMAIN_=mycloud.ownyourbits.com
|
||||
IP_=127.0.0.1
|
||||
DNSSERVER_=8.8.8.8
|
||||
CACHESIZE_=150
|
||||
DESCRIPTION="DNS server with cache"
|
||||
DESCRIPTION="dnsmasq: DNS server with cache"
|
||||
|
||||
install()
|
||||
{
|
||||
|
||||
@ -25,7 +25,7 @@ FINDTIME_=600
|
||||
# bad attempts before banning an IP
|
||||
MAXRETRY_=6
|
||||
|
||||
DESCRIPTION="Brute force protection"
|
||||
DESCRIPTION="fail2ban: Brute force protection"
|
||||
|
||||
install()
|
||||
{
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
# Set DOWNLOAD=0 if you have already downloaded an image. Rename it to nextcloudpi.img
|
||||
|
||||
IP=$1 # First argument is the QEMU Raspbian IP address
|
||||
DOWNLOAD=0 # Download the latest image
|
||||
DOWNLOAD=1 # Download the latest image
|
||||
EXTRACT=1 # Extract the image from zip, so start from 0
|
||||
IMG=raspbian_lite_latest
|
||||
INSTALL_SCRIPT=nextcloud.sh
|
||||
|
||||
@ -18,7 +18,13 @@ DESCRIPTION="Change your data dir location"
|
||||
|
||||
configure()
|
||||
{
|
||||
[ -d $DATADIR_ ] && { echo "$DATADIR_ already exists" && return 1; }
|
||||
[ -d $DATADIR_ ] && {
|
||||
[[ $( find "$DATADIR_" -maxdepth 0 -empty | wc -l ) == 0 ]] && {
|
||||
echo "$DATADIR_ is not empty"
|
||||
return 1
|
||||
}
|
||||
rmdir "$DATADIR_"
|
||||
}
|
||||
|
||||
service apache2 stop
|
||||
|
||||
|
||||
@ -19,11 +19,11 @@ function nextcloud-config()
|
||||
local DIALOG_OK=0
|
||||
local LIST=()
|
||||
for item in $CONFDIR/*.sh; do
|
||||
local DESC="$( grep "DESCRIPTION=" $item | sed 's|^DESCRIPTION=||' )"
|
||||
local DESC=$( grep "DESCRIPTION=" $item | sed 's|^DESCRIPTION="||;s|"$||' )
|
||||
LIST+=( $( basename $item .sh ) "$DESC" )
|
||||
done
|
||||
local script
|
||||
script=$( dialog --backtitle "NextCloudPi configuration" \
|
||||
script=$( dialog --notags --backtitle "NextCloudPi configuration" \
|
||||
--menu "Select program to configure and activate:" 20 80 10 \
|
||||
"${LIST[@]}" \
|
||||
3>&1 1>&2 2>&3 )
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user