check for empty directory nc-datadir.

make menu prettier
This commit is contained in:
nachoparker 2017-03-14 19:44:37 +01:00
parent 2a49453204
commit 6ed507a7f7
6 changed files with 13 additions and 7 deletions

View File

@ -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()
{

View File

@ -25,7 +25,7 @@ FINDTIME_=600
# bad attempts before banning an IP
MAXRETRY_=6
DESCRIPTION="Brute force protection"
DESCRIPTION="fail2ban: Brute force protection"
install()
{

View File

@ -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

View File

@ -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

View File

@ -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 )

View File

@ -16,7 +16,7 @@
USER_=my-noip-user@email.com
PASS_=noip-pass
TIME_=30
DESCRIPTION="free Dynamic DNS provider (need account)"
DESCRIPTION="no-ip.org: free Dynamic DNS provider (need account)"
install()
{