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
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-08-07 23:33:55 +0300
committernachoparker <nacho@ownyourbits.com>2017-08-11 00:17:56 +0300
commit7111bb2c22e397e79365ac3a16969e79bf147ede (patch)
tree7ef6075a0e222e98f4c43c1b534922e340c08400
parent744c716d0b2485adf45a1c753b1744a69548ff92 (diff)
NFS: more info and rearrange code
-rw-r--r--etc/nextcloudpi-config.d/NFS.sh64
1 files changed, 35 insertions, 29 deletions
diff --git a/etc/nextcloudpi-config.d/NFS.sh b/etc/nextcloudpi-config.d/NFS.sh
index 31d6837c..f854bd29 100644
--- a/etc/nextcloudpi-config.d/NFS.sh
+++ b/etc/nextcloudpi-config.d/NFS.sh
@@ -26,35 +26,6 @@ install()
apt-get update
apt-get install --no-install-recommends -y nfs-kernel-server
systemctl disable nfs-kernel-server
-}
-
-show_info()
-{
- whiptail --yesno \
- --backtitle "NextCloudPi configuration" \
- --title "Instructions for external synchronization" \
-"If we intend to modify the data folder through NFS,
-then we have to synchronize NextCloud to make it aware of the changes. \n
-This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'
-from 'nextcloudpi-config'" \
- 20 90
-}
-
-configure()
-{
- [[ $ACTIVE_ != "yes" ]] && { service nfs-kernel-server stop; systemctl disable nfs-kernel-server; return; }
-
- # CHECKS
- ################################
- [ -d "$DIR_" ] || { echo -e "INFO: directory $DIR_ does not exist. Creating"; mkdir -p "$DIR_"; }
- [[ $( stat -fc%d / ) == $( stat -fc%d $DIR_ ) ]] && \
- echo -e "INFO: mounting a in the SD card\nIf you want to use an external mount, make sure it is properly set up"
-
- # CONFIG
- ################################
- cat > /etc/exports <<EOF
-$DIR_ $SUBNET_(rw,sync,all_squash,anonuid=$(id -u $USER_),anongid=$(id -g $GROUP_),no_subtree_check)
-EOF
cat > /etc/systemd/system/nfs-common.services <<EOF
[Unit]
@@ -89,10 +60,45 @@ Restart=on-failure
WantedBy=sysinit.target
Alias=portmap
EOF
+}
+
+show_info()
+{
+ whiptail --yesno \
+ --backtitle "NextCloudPi configuration" \
+ --title "Instructions for external synchronization" \
+"If we intend to modify the data folder through NFS,
+then we have to synchronize NextCloud to make it aware of the changes. \n
+This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'
+from 'nextcloudpi-config'" \
+ 20 90
+}
+
+configure()
+{
+ [[ $ACTIVE_ != "yes" ]] && {
+ service nfs-kernel-server stop
+ systemctl disable nfs-kernel-server
+ echo -e "NFS disabled"
+ return
+ }
+
+ # CHECKS
+ ################################
+ [ -d "$DIR_" ] || { echo -e "INFO: directory $DIR_ does not exist. Creating"; mkdir -p "$DIR_"; }
+ [[ $( stat -fc%d / ) == $( stat -fc%d $DIR_ ) ]] && \
+ echo -e "INFO: mounting a in the SD card\nIf you want to use an external mount, make sure it is properly set up"
+
+ # CONFIG
+ ################################
+ cat > /etc/exports <<EOF
+$DIR_ $SUBNET_(rw,sync,all_squash,anonuid=$(id -u $USER_),anongid=$(id -g $GROUP_),no_subtree_check)
+EOF
systemctl enable rpcbind
systemctl enable nfs-kernel-server
service nfs-kernel-server restart
+ echo -e "NFS enabled"
}
cleanup()