Skip to content

Commit 64bf42f

Browse files
committed
added show_info() to nextcloudpi-config
1 parent fb994ad commit 64bf42f

File tree

10 files changed

+80
-21
lines changed

10 files changed

+80
-21
lines changed

bin/nextcloudpi-config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function nextcloud-config()
4949
[[ $? -ne $DIALOG_OK ]] || [[ "$script" == "" ]] && return 0
5050

5151
# launch selected script
52+
info_script $script.sh || return 1;
5253
configure_script $script.sh
5354
}
5455

etc/library.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,18 @@ function install_script()
215215
)
216216
}
217217

218+
function info_script()
219+
{
220+
(
221+
local SCRIPT=$1
222+
cd /usr/local/etc/nextcloudpi-config.d/
223+
unset show_info
224+
source ./$SCRIPT
225+
[[ $( type -t show_info ) == function ]] || return 0
226+
[[ $( type -t show_info ) == function ]] && show_info
227+
)
228+
}
229+
218230
function configure_script()
219231
{
220232
(

etc/nextcloudpi-config.d/NFS.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,20 @@ install()
2727
systemctl disable nfs-kernel-server
2828
}
2929

30-
configure()
30+
show_info()
3131
{
32-
# INFO
33-
################################
34-
whiptail --msgbox \
32+
whiptail --yesno \
3533
--backtitle "NextCloudPi configuration" \
3634
--title "Instructions for external synchronization" \
3735
"If we intend to modify the data folder through NFS,
3836
then we have to synchronize NextCloud to make it aware of the changes. \n
3937
This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'
4038
from 'nextcloudpi-config'" \
4139
20 90
40+
}
4241

42+
configure()
43+
{
4344
# CHECKS
4445
################################
4546
[ -d "$DIR_" ] || { echo -e "INFO: directory $DIR_ does not exist. Creating"; mkdir -p "$DIR_"; }

etc/nextcloudpi-config.d/letsencrypt.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ install()
2626
/etc/letsencrypt/letsencrypt-auto --help # do not actually run certbot, only install packages
2727
}
2828

29+
show_info()
30+
{
31+
whiptail --yesno \
32+
--backtitle "NextCloudPi configuration" \
33+
--title "Warning" \
34+
"Internet access is required for this configuration to complete" \
35+
20 90
36+
}
37+
2938
# tested with git version v0.11.0-71-g018a304
3039
configure()
3140
{

etc/nextcloudpi-config.d/modsecurity.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ EOF
8888
EOF
8989
}
9090

91+
show_info()
92+
{
93+
whiptail --yesno \
94+
--backtitle "NextCloudPi configuration" \
95+
--title "Experimental feature warning" \
96+
"This feature is highly experimental and has only been tested with
97+
a basic NextCloud installation. If a new App does not work disable it" \
98+
20 90
99+
}
100+
91101
configure()
92102
{
93103
[[ $ACTIVE_ == "yes" ]] && local STATE=On || local STATE=Off

etc/nextcloudpi-config.d/nc-ramlogs.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
ACTIVE_=no
1919
DESCRIPTION="mount logs in RAM to prevent SD card degradation (faster, consumes more RAM)"
2020

21+
show_info()
22+
{
23+
whiptail --yesno \
24+
--backtitle "NextCloudPi configuration" \
25+
--title "Warning" \
26+
"If you are installing software other than NextCloud
27+
that creates folders under '/var/log/' disable this feature" \
28+
20 90
29+
}
30+
2131
configure()
2232
{
2333
[[ $ACTIVE_ != "yes" ]] && {

etc/nextcloudpi-config.d/nc-scan-auto.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@
1717
SCANINTERVAL_=60
1818
DESCRIPTION="Periodically scan NC for externally modified files"
1919

20-
configure()
20+
show_info()
2121
{
22-
whiptail --msgbox \
22+
whiptail --yesno \
2323
--backtitle "NextCloudPi configuration" \
2424
--title "Instructions for auto synchronization" \
2525
"Set the time in minutes in SCANINTERVAL. \n
2626
>>> If there are too many files this can greatly affect performance. <<< \n
2727
SCANINTERVAL=0 will disable periodic synchronization." \
2828
20 90
29+
}
2930

31+
configure()
32+
{
3033
[[ $SCANINTERVAL_ == 0 ]] && {
3134
systemctl stop nc-scan.timer
3235
systemctl disable nc-scan.timer

etc/nextcloudpi-config.d/nc-wifi.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ install()
2424
systemctl disable wicd
2525
}
2626

27+
show_info()
28+
{
29+
whiptail --yesno \
30+
--backtitle "NextCloudPi configuration" \
31+
--title "Instructions to configure Wi-Fi" \
32+
"1) Select a Wi-Fi network
33+
2) Press right arrow ->
34+
3) Enter the passphrase for your Wi-Fi
35+
4) Make sure to select 'connect automatically'
36+
5) F10 to save
37+
6) C to connect" \
38+
20 90
39+
}
40+
2741
configure()
2842
{
2943
# Installation in QEMU (without a wireless interface) produces
@@ -41,17 +55,6 @@ configure()
4155
systemctl enable wicd
4256
systemctl start wicd
4357

44-
whiptail --msgbox \
45-
--backtitle "NextCloudPi configuration" \
46-
--title "Instructions to configure Wi-Fi" \
47-
"1) Select a Wi-Fi network
48-
2) Press right arrow ->
49-
3) Enter the passphrase for your Wi-Fi
50-
4) Make sure to select 'connect automatically'
51-
5) F10 to save
52-
6) C to connect" \
53-
20 90
54-
5558
wicd-curses
5659
}
5760

etc/nextcloudpi-config.d/no-ip.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ EOF
5151
rm -r /tmp/noip
5252
}
5353

54+
show_info()
55+
{
56+
whiptail --yesno \
57+
--backtitle "NextCloudPi configuration" \
58+
--title "Warning" \
59+
"Internet access is required for this configuration to complete" \
60+
20 90
61+
}
62+
5463
configure()
5564
{
5665
[[ $ACTIVE_ == "no" ]] && { service noip2 stop; update-rc.d noip2 disable; return; }

etc/nextcloudpi-config.d/samba.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,20 @@ install()
2929
grep -q mkdir /etc/init.d/smbd || sed -i "/\<start)/amkdir -p /var/log/samba" /etc/init.d/smbd
3030
}
3131

32-
configure()
32+
show_info()
3333
{
34-
# INFO
35-
################################
36-
whiptail --msgbox \
34+
whiptail --yesno \
3735
--backtitle "NextCloudPi configuration" \
3836
--title "Instructions for external synchronization" \
3937
"If we intend to modify the data folder through SAMBA,
4038
then we have to synchronize NextCloud to make it aware of the changes. \n
4139
This can be done manually or automatically using 'nc-scan' and 'nc-scan-auto'
4240
from 'nextcloudpi-config'" \
4341
20 90
42+
}
4443

44+
configure()
45+
{
4546
# CHECKS
4647
################################
4748
[ -d "$DIR_" ] || { echo -e "INFO: directory $DIR_ does not exist. Creating"; mkdir -p "$DIR_"; }

0 commit comments

Comments
 (0)