mirror of
https://github.com/nextcloud/nextcloudpi.git
synced 2026-01-10 15:12:01 -03:30
ncp updates and motd. structure directories
This commit is contained in:
parent
7aa9c1c091
commit
75b42680fe
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
.*.swp
|
||||
*.img
|
||||
*.bz2
|
||||
|
||||
2
batch.sh
2
batch.sh
@ -9,7 +9,7 @@
|
||||
# Usage:
|
||||
#
|
||||
|
||||
source library.sh # initializes $IMGNAME
|
||||
source etc/library.sh # initializes $IMGNAME
|
||||
|
||||
IP=$1 # First argument is the QEMU Raspbian IP address
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
CONFDIR=/usr/local/etc/nextcloudpi-config.d/
|
||||
|
||||
source $CONFDIR/library
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
function nextcloud-config()
|
||||
{
|
||||
@ -34,14 +34,7 @@ function nextcloud-config()
|
||||
|
||||
[[ $? -ne $DIALOG_OK ]] || [[ "$script" == "" ]] && return 0
|
||||
|
||||
(
|
||||
cd $CONFDIR
|
||||
config $script.sh || return 1 # writes "$INSTALLATION_CODE"
|
||||
echo -e "$INSTALLATION_CODE" > $script.sh # save configuration
|
||||
source ./$script.sh # load configuration
|
||||
set +x
|
||||
configure
|
||||
)
|
||||
configure_script $script.sh
|
||||
}
|
||||
|
||||
if [ $(id -u) -ne 0 ]; then
|
||||
@ -202,6 +202,33 @@ function config()
|
||||
[[ "$CFGOUT" != "" ]] && echo -e "$CONFIG" > "$CFGOUT"
|
||||
}
|
||||
|
||||
|
||||
function install_script()
|
||||
{
|
||||
(
|
||||
local SCRIPT=$1
|
||||
source ./$SCRIPT
|
||||
echo -e "Installing \e[1m$( basename $SCRIPT .sh )\e[0m"
|
||||
set +x
|
||||
install
|
||||
cleanup
|
||||
)
|
||||
}
|
||||
|
||||
function configure_script()
|
||||
{
|
||||
(
|
||||
local SCRIPT=$1
|
||||
cd /usr/local/etc/nextcloudpi-config.d/
|
||||
config $SCRIPT || return 1 # writes "$INSTALLATION_CODE"
|
||||
echo -e "$INSTALLATION_CODE" > $SCRIPT # save configuration
|
||||
source ./$SCRIPT # load configuration
|
||||
echo -e "Configuring \e[1m$( basename $SCRIPT .sh )\e[0m"
|
||||
set +x
|
||||
configure
|
||||
)
|
||||
}
|
||||
|
||||
function copy_to_image()
|
||||
{
|
||||
local IMG=$1
|
||||
@ -223,7 +250,7 @@ function pack_image()
|
||||
local IMGOUT="$1"
|
||||
local IMGNAME="$2"
|
||||
local TARNAME=$( basename $IMGNAME .img ).tar.bz2
|
||||
echo "copying $IMGNAME → $TARNAME"
|
||||
echo "copying $IMGOUT → $IMGNAME"
|
||||
cp "$IMGOUT" "$IMGNAME" || return 1
|
||||
echo "packing $IMGNAME → $TARNAME"
|
||||
tar -I pbzip2 -cvf $TARNAME "$IMGNAME" &>/dev/null && \
|
||||
30
etc/ncp-ascii.txt
Normal file
30
etc/ncp-ascii.txt
Normal file
@ -0,0 +1,30 @@
|
||||
[48;5;16;38;5;16m▄▄▄[38;5;235m▄[48;5;232;38;5;31m▄[48;5;23;38;5;32m▄[48;5;24m▄[48;5;31m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;31m▄[48;5;24m▄[48;5;23m▄[48;5;232;38;5;25m▄[48;5;16;38;5;233m▄[38;5;16m▄▄▄[0m
|
||||
[48;5;16;38;5;16m▄[38;5;235m▄[48;5;23;38;5;32m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;31m▄[48;5;233;38;5;31m▄[48;5;16;38;5;233m▄[38;5;16m▄[0m
|
||||
[48;5;232;38;5;23m▄[48;5;31;38;5;32m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;25m▄[48;5;16;38;5;23m▄[0m
|
||||
[48;5;24;38;5;31m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;24;38;5;31m▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[38;5;31m▄[38;5;24m▄[38;5;23m▄[38;5;235m▄[38;5;234m▄[38;5;233m▄[38;5;234m▄[38;5;236m▄[38;5;23m▄[38;5;31m▄[38;5;32m▄▄▄▄[38;5;31m▄[38;5;23m▄[38;5;235m▄[38;5;234m▄[38;5;233m▄[38;5;234m▄[38;5;235m▄[38;5;23m▄[38;5;24m▄[38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;23;38;5;237m▄[48;5;232;38;5;58m▄[48;5;234;38;5;70m▄[48;5;58;38;5;106m▄[48;5;64m▄▄▄▄[48;5;58m▄[48;5;235;38;5;70m▄[48;5;232;38;5;64m▄[48;5;24;38;5;233m▄[48;5;32;38;5;31m▄[38;5;23m▄[48;5;236;38;5;234m▄[48;5;232;38;5;64m▄[48;5;235;38;5;106m▄[48;5;64m▄▄▄▄[48;5;58m▄▄[48;5;233;38;5;70m▄[38;5;235m▄[48;5;25;38;5;24m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;236;38;5;23m▄[48;5;58;38;5;234m▄[48;5;106;38;5;106m▄▄[48;5;70m▄[48;5;64;38;5;70m▄[48;5;70;38;5;58m▄[48;5;106m▄[38;5;70m▄[38;5;106m▄▄[48;5;64;38;5;70m▄[48;5;236;38;5;232m▄[48;5;232;38;5;235m▄[48;5;64;38;5;106m▄[48;5;106m▄▄[38;5;64m▄[38;5;58m▄[48;5;70m▄[48;5;64;38;5;70m▄[48;5;70;38;5;106m▄[48;5;106m▄[38;5;70m▄[48;5;234;38;5;233m▄[48;5;24;38;5;31m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;31m▄[48;5;232;38;5;236m▄[48;5;64;38;5;58m▄[48;5;106;38;5;106m▄▄▄▄[48;5;64m▄[48;5;235;38;5;70m▄[48;5;64;38;5;235m▄[48;5;106;38;5;58m▄[48;5;70m▄[48;5;232;38;5;16m▄[48;5;235m▄[48;5;106;38;5;58m▄[38;5;236m▄[48;5;58;38;5;58m▄[48;5;236;38;5;106m▄[48;5;64m▄[48;5;106m▄▄▄[38;5;70m▄[48;5;64;38;5;234m▄[48;5;235;38;5;23m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;24m▄[48;5;233;38;5;24m▄[48;5;58;38;5;233m▄[48;5;106;38;5;236m▄[38;5;70m▄[38;5;106m▄▄▄[48;5;70;38;5;58m▄[48;5;233;38;5;16m▄[48;5;16m▄▄▄▄[48;5;235;38;5;232m▄[48;5;106;38;5;64m▄[38;5;106m▄▄▄[38;5;70m▄[48;5;70;38;5;234m▄[48;5;236m▄[48;5;235;38;5;31m▄[48;5;31;38;5;32m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;25;38;5;25m▄[48;5;234;38;5;234m▄[48;5;233;38;5;232m▄[48;5;58;38;5;52m▄▄[48;5;235;38;5;233m▄[48;5;16;38;5;16m▄[38;5;52m▄[38;5;125m▄[48;5;233m▄[48;5;232m▄[48;5;16;38;5;89m▄[38;5;234m▄[48;5;232;38;5;232m▄[48;5;236;38;5;52m▄[48;5;58m▄[38;5;233m▄[48;5;232;38;5;16m▄[48;5;236;38;5;237m▄[48;5;31;38;5;31m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄[38;5;74m▄▄[38;5;32m▄▄▄▄▄▄▄[38;5;31m▄[48;5;24;38;5;233m▄[48;5;233;38;5;88m▄[48;5;52;38;5;125m▄[48;5;125m▄▄[38;5;232m▄[48;5;232;38;5;16m▄[48;5;52;38;5;52m▄[48;5;125;38;5;125m▄▄▄▄▄▄[48;5;52;38;5;52m▄[48;5;89;38;5;232m▄[48;5;125;38;5;89m▄[38;5;125m▄[48;5;88m▄[48;5;232;38;5;89m▄[48;5;234;38;5;16m▄[48;5;31;38;5;236m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄[38;5;74m▄▄[38;5;32m▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄[38;5;189m▄[48;5;74;38;5;231m▄[48;5;189m▄[48;5;231m▄▄▄▄[48;5;195m▄[48;5;110m▄[48;5;32;38;5;189m▄[38;5;32m▄▄▄[48;5;24;38;5;24m▄[48;5;232;38;5;234m▄[48;5;125;38;5;125m▄[38;5;88m▄[48;5;89;38;5;232m▄[48;5;232;38;5;16m▄[48;5;16;38;5;52m▄▄▄[48;5;52;38;5;232m▄[48;5;125;38;5;16m▄[38;5;232m▄[38;5;16m▄▄[48;5;52;38;5;52m▄[48;5;16;38;5;89m▄[38;5;88m▄[38;5;52m▄[48;5;88;38;5;16m▄[48;5;125;38;5;52m▄[38;5;125m▄[48;5;234;38;5;52m▄[48;5;232;38;5;16m▄[48;5;32;38;5;31m▄[38;5;32m▄▄[38;5;74m▄[38;5;231m▄[48;5;116m▄[48;5;231m▄▄▄▄▄[48;5;153m▄[48;5;74m▄[48;5;32;38;5;152m▄[38;5;32m▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄[38;5;189m▄[48;5;195;38;5;231m▄[48;5;231m▄▄▄▄▄▄▄▄▄▄[48;5;195m▄[48;5;74;38;5;195m▄[48;5;32;38;5;60m▄[48;5;23;38;5;232m▄[48;5;232;38;5;234m▄[48;5;234;38;5;16m▄[48;5;16m▄[48;5;233;38;5;89m▄[48;5;89;38;5;125m▄[48;5;125m▄▄▄▄[48;5;234m▄[48;5;16;38;5;16m▄[38;5;234m▄[48;5;88;38;5;125m▄[48;5;125m▄▄▄▄[48;5;89m▄[48;5;232;38;5;88m▄[48;5;233;38;5;16m▄[48;5;234;38;5;233m▄[48;5;16;38;5;234m▄[48;5;24;38;5;232m▄[48;5;32;38;5;67m▄[48;5;74;38;5;231m▄[48;5;231m▄▄▄▄▄▄▄▄▄▄▄[48;5;189m▄[48;5;32;38;5;152m▄[38;5;32m▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄[48;5;74;38;5;189m▄[48;5;231;38;5;231m▄▄▄▄[38;5;153m▄[38;5;32m▄[48;5;153m▄▄[48;5;231m▄[38;5;152m▄[38;5;231m▄▄▄[48;5;250;38;5;237m▄[48;5;232;38;5;52m▄[48;5;89;38;5;125m▄[48;5;125m▄[48;5;16;38;5;232m▄[48;5;233;38;5;52m▄[48;5;125;38;5;125m▄▄▄▄▄▄▄[48;5;232;38;5;232m▄[48;5;52;38;5;234m▄[48;5;125;38;5;125m▄▄▄▄▄▄▄[48;5;232;38;5;233m▄[48;5;88;38;5;89m▄[48;5;125;38;5;125m▄[48;5;52m▄[48;5;235;38;5;16m▄[48;5;231;38;5;245m▄[38;5;231m▄▄▄[38;5;74m▄[48;5;195;38;5;32m▄[48;5;153m▄[48;5;189m▄[48;5;231m▄[38;5;189m▄[38;5;231m▄▄▄▄[48;5;32;38;5;116m▄[38;5;32m▄▄[0m
|
||||
[48;5;32;38;5;32m▄[38;5;74m▄[48;5;231;38;5;231m▄▄▄▄[38;5;189m▄[48;5;32;38;5;32m▄▄▄▄▄▄[48;5;189;38;5;110m▄[48;5;231;38;5;231m▄[48;5;254;38;5;254m▄[48;5;232;38;5;16m▄[48;5;125;38;5;125m▄▄▄[48;5;232;38;5;16m▄[48;5;52;38;5;233m▄[48;5;125;38;5;125m▄▄▄▄▄▄[48;5;88;38;5;233m▄[48;5;16;38;5;16m▄▄[48;5;125;38;5;234m▄[38;5;125m▄▄▄▄▄[38;5;89m▄[48;5;232;38;5;16m▄[48;5;89;38;5;52m▄[48;5;125;38;5;125m▄▄[48;5;233;38;5;233m▄[48;5;238;38;5;236m▄[48;5;231;38;5;231m▄▄[48;5;116;38;5;74m▄[48;5;32;38;5;32m▄▄▄▄▄[48;5;74m▄[48;5;231;38;5;231m▄▄▄▄[48;5;189m▄[48;5;32;38;5;32m▄▄[0m
|
||||
[48;5;32;38;5;32m▄[48;5;74m▄[48;5;231;38;5;231m▄▄▄▄[48;5;153m▄[48;5;32;38;5;32m▄▄▄▄▄▄[48;5;110;38;5;189m▄[48;5;231;38;5;231m▄▄[48;5;232;38;5;241m▄[48;5;89;38;5;234m▄[48;5;125;38;5;125m▄[48;5;88;38;5;234m▄[48;5;16;38;5;16m▄▄[48;5;52m▄[48;5;125;38;5;233m▄[38;5;52m▄▄[38;5;232m▄[48;5;233;38;5;52m▄[48;5;232;38;5;125m▄[48;5;233m▄▄[48;5;16m▄[48;5;234;38;5;52m▄[48;5;125;38;5;232m▄[38;5;233m▄▄[38;5;16m▄[48;5;233m▄[48;5;16m▄[48;5;52;38;5;232m▄[48;5;125;38;5;125m▄[38;5;52m▄[48;5;232;38;5;16m▄[48;5;239;38;5;249m▄[48;5;231;38;5;231m▄▄[48;5;74;38;5;116m▄[48;5;32;38;5;32m▄▄▄▄▄[38;5;74m▄[48;5;231;38;5;231m▄▄▄▄[38;5;195m▄[48;5;32;38;5;32m▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄[48;5;189;38;5;74m▄[48;5;231;38;5;231m▄▄▄▄[48;5;153m▄[48;5;32;38;5;195m▄[38;5;116m▄[38;5;110m▄[38;5;189m▄[48;5;152;38;5;231m▄[48;5;231m▄▄▄[48;5;254m▄[48;5;235;38;5;244m▄[48;5;233;38;5;16m▄[48;5;232;38;5;88m▄[48;5;52;38;5;125m▄[48;5;234m▄[48;5;16;38;5;88m▄[38;5;16m▄▄▄[48;5;52;38;5;125m▄[48;5;125m▄▄▄▄▄▄[48;5;52;38;5;89m▄[48;5;16;38;5;16m▄▄[38;5;52m▄[48;5;52;38;5;125m▄[48;5;125m▄[48;5;89m▄[48;5;232;38;5;52m▄[48;5;16;38;5;16m▄[48;5;241;38;5;252m▄[48;5;231;38;5;231m▄▄▄▄[48;5;74m▄[48;5;32;38;5;153m▄[38;5;110m▄[38;5;152m▄[38;5;231m▄[48;5;189m▄[48;5;231m▄▄▄▄[48;5;116;38;5;68m▄[48;5;32;38;5;32m▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄[48;5;195;38;5;74m▄[48;5;231;38;5;231m▄▄▄▄▄▄▄▄▄▄▄▄[38;5;74m▄[48;5;67;38;5;32m▄[48;5;16;38;5;234m▄[48;5;125;38;5;89m▄[38;5;125m▄▄▄[48;5;88m▄[48;5;16;38;5;52m▄[38;5;16m▄[48;5;125;38;5;89m▄[38;5;125m▄▄▄▄▄▄[38;5;88m▄[48;5;16;38;5;233m▄[48;5;52;38;5;125m▄[48;5;125m▄▄▄▄[48;5;52;38;5;52m▄[48;5;234;38;5;23m▄[48;5;74;38;5;32m▄[48;5;231;38;5;110m▄[38;5;231m▄▄▄▄▄▄▄▄▄▄▄[38;5;195m▄[48;5;153;38;5;32m▄[48;5;32m▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄[48;5;74m▄[48;5;195m▄[48;5;231;38;5;116m▄[38;5;231m▄▄▄▄▄▄[38;5;153m▄[48;5;195;38;5;32m▄[48;5;74m▄[48;5;32m▄▄[48;5;23;38;5;25m▄[48;5;52;38;5;232m▄[48;5;125;38;5;89m▄[38;5;125m▄▄▄▄[48;5;232;38;5;233m▄[48;5;52;38;5;16m▄[48;5;125;38;5;52m▄[38;5;125m▄▄▄[38;5;89m▄[38;5;234m▄[48;5;233;38;5;16m▄[48;5;52;38;5;89m▄[48;5;125;38;5;125m▄▄▄▄[38;5;52m▄[48;5;232;38;5;233m▄[48;5;24;38;5;31m▄[48;5;32;38;5;32m▄▄[48;5;110m▄[48;5;231;38;5;74m▄[38;5;189m▄[38;5;231m▄▄▄▄▄[38;5;195m▄[38;5;74m▄[48;5;189;38;5;32m▄[48;5;32m▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄[48;5;74m▄▄▄▄[48;5;32m▄▄▄▄▄▄▄[48;5;23m▄[48;5;232;38;5;24m▄[48;5;88;38;5;233m▄[48;5;125m▄[38;5;52m▄[38;5;233m▄[48;5;232;38;5;16m▄[48;5;16;38;5;232m▄[38;5;52m▄▄[48;5;232;38;5;88m▄▄[48;5;16m▄[38;5;52m▄[38;5;232m▄[48;5;89m▄[48;5;125;38;5;52m▄▄[38;5;233m▄[48;5;52;38;5;235m▄[48;5;232;38;5;25m▄[48;5;24;38;5;32m▄[48;5;32m▄▄▄▄▄▄▄[48;5;74m▄[48;5;110m▄[48;5;74m▄▄[48;5;32m▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;23m▄[48;5;16;38;5;24m▄[38;5;235m▄[38;5;16m▄[48;5;125;38;5;52m▄[38;5;125m▄▄▄▄▄▄[48;5;88;38;5;233m▄[48;5;16;38;5;232m▄[38;5;237m▄[48;5;232;38;5;31m▄[48;5;24;38;5;32m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;25m▄[48;5;234;38;5;31m▄[48;5;52;38;5;23m▄[48;5;88;38;5;234m▄[48;5;125;38;5;232m▄[48;5;89;38;5;234m▄[48;5;52;38;5;23m▄[48;5;233;38;5;31m▄[48;5;236;38;5;32m▄[48;5;31m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;31m▄[48;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[0m
|
||||
[48;5;31;38;5;24m▄[48;5;32;38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[48;5;31;38;5;24m▄[0m
|
||||
[48;5;23;38;5;232m▄[48;5;32;38;5;25m▄[38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[38;5;24m▄[48;5;234;38;5;16m▄[0m
|
||||
[48;5;16;38;5;16m▄[48;5;233m▄[48;5;31;38;5;233m▄[48;5;32;38;5;31m▄[38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[38;5;31m▄[48;5;25;38;5;232m▄[48;5;232;38;5;16m▄[48;5;16m▄[0m
|
||||
[48;5;16;38;5;16m▄▄▄[48;5;233m▄[48;5;25m▄[48;5;32;38;5;235m▄[38;5;24m▄[38;5;31m▄[38;5;32m▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄[38;5;31m▄[38;5;24m▄[38;5;233m▄[48;5;24;38;5;16m▄[48;5;232m▄[48;5;16m▄▄▄[0m
|
||||
44
etc/nextcloudpi-config.d/nc-update.sh
Executable file
44
etc/nextcloudpi-config.d/nc-update.sh
Executable file
@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Data dir configuration script for NextCloudPi
|
||||
# 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:
|
||||
#
|
||||
# ./installer.sh nc-update.sh <IP> (<img>)
|
||||
#
|
||||
# See installer.sh instructions for details
|
||||
#
|
||||
# More at https://ownyourbits.com/
|
||||
#
|
||||
|
||||
DESCRIPTION="Update NextCloudPi"
|
||||
|
||||
configure()
|
||||
{
|
||||
/usr/local/bin/ncp-update
|
||||
}
|
||||
|
||||
install() { :; }
|
||||
cleanup() { :; }
|
||||
|
||||
# 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
|
||||
|
||||
@ -22,7 +22,7 @@ EXTRACT=1 # Extract the image from zip, so start from 0
|
||||
IMG=raspbian_lite_latest
|
||||
INSTALL_SCRIPT=nextcloud.sh
|
||||
|
||||
source library.sh # initializes $IMGOUT
|
||||
source etc/library.sh # initializes $IMGNAME
|
||||
|
||||
[[ "$DOWNLOAD" == "1" ]] && { wget https://downloads.raspberrypi.org/$IMG -O $IMG.zip || exit; }
|
||||
[[ "$DOWNLOAD" == "1" ]] || [[ "$EXTRACT" == "1" ]] && {
|
||||
@ -33,13 +33,8 @@ source library.sh # initializes $IMGOUT
|
||||
|
||||
IMGOUT="NextCloudPi_$( date "+%m-%d-%y" ).img"
|
||||
|
||||
config $INSTALL_SCRIPT || exit 1
|
||||
launch_install_qemu "$IMGFILE" $IP || exit 1
|
||||
|
||||
CONFDIR=/usr/local/etc/nextcloudpi-config.d/
|
||||
copy_to_image "$IMGOUT" $CONFDIR nc-limits.sh nc-datadir.sh nc-httpsonly.sh
|
||||
copy_to_image "$IMGOUT" $CONFDIR/library library.sh
|
||||
copy_to_image "$IMGOUT" /usr/local/bin/ nextcloudpi-config
|
||||
config $INSTALL_SCRIPT || exit 1
|
||||
launch_install_qemu "$IMGFILE" $IP || exit 1 # initializes $IMGOUT
|
||||
|
||||
pack_image $IMGFILE $IMGOUT
|
||||
|
||||
|
||||
@ -35,15 +35,13 @@
|
||||
INSTALL_SCRIPT=$1 # First argument is the script to be run inside Raspbian
|
||||
IP=$2 # Second argument is the QEMU Raspbian IP address
|
||||
IMGFILE=$3 # Third argument is the image file to start from ( empty for online installation )
|
||||
CONFDIR=/usr/local/etc/nextcloudpi-config.d/
|
||||
|
||||
source library.sh # initializes $IMGNAME
|
||||
source etc/library.sh # initializes $IMGNAME
|
||||
|
||||
config $INSTALL_SCRIPT || exit 1
|
||||
|
||||
if [[ "$IMGFILE" != "" ]]; then
|
||||
launch_install_qemu "$IMGFILE" $IP || exit 1 # initializes $IMGOUT
|
||||
copy_to_image "$IMGOUT" $CONFDIR $INSTALL_SCRIPT || exit 1
|
||||
launch_install_qemu "$IMGFILE" $IP || exit 1 # initializes $IMGOUT
|
||||
pack_image "$IMGOUT" "$IMGNAME"
|
||||
else
|
||||
launch_installation_online $IP
|
||||
|
||||
103
nextcloud.sh
103
nextcloud.sh
@ -228,10 +228,111 @@ EXIT
|
||||
EOF
|
||||
|
||||
# NEXTCLOUDPI-CONFIG
|
||||
##########################################
|
||||
|
||||
$APTINSTALL dialog
|
||||
mkdir -p $CONFDIR
|
||||
sed -i '/Change User Password/i"0 NextCloudPi Configuration" "Configuration of NextCloudPi" \\\\' /usr/bin/raspi-config
|
||||
sed -i '/1\\\\ \*) do_change_pass ;;/i0\\\\ *) nextcloudpi-config ;;' /usr/bin/raspi-config
|
||||
sed -i '/1\\\\ \*) do_change_pass ;;/i0\\\\ *) nextcloudpi-config ;;' /usr/bin/raspi-config
|
||||
|
||||
# NEXTCLOUDPI MOTD
|
||||
##########################################
|
||||
mkdir /etc/update-motd.d
|
||||
rm /etc/motd
|
||||
ln -s /var/run/motd /etc/motd
|
||||
|
||||
cat > /etc/update-motd.d/10logo <<EOF
|
||||
#!/bin/sh
|
||||
echo
|
||||
cat /usr/local/etc/ncp-ascii.txt
|
||||
EOF
|
||||
|
||||
cat > /etc/update-motd.d/20updates <<'EOF'
|
||||
#!/bin/bash
|
||||
/usr/local/bin/ncp-check-updates
|
||||
EOF
|
||||
chmod a+x /etc/update-motd.d/*
|
||||
|
||||
# NEXTCLOUDPI UPDATES
|
||||
##########################################
|
||||
$APTINSTALL git
|
||||
|
||||
cat > /usr/local/bin/ncp-check-updates <<'EOF'
|
||||
#!/bin/bash
|
||||
|
||||
NEED_UPDATE=false
|
||||
VERFILE=/var/run/.ncp-latest-version
|
||||
|
||||
if test -f $VERFILE && grep -qP "v\d+\.\d+\.\d+" $VERFILE; then
|
||||
|
||||
MAJOR=$( grep -oP "\d+\.\d+\.\d+" $VERFILE | cut -d. -f1 )
|
||||
MINOR=$( grep -oP "\d+\.\d+\.\d+" $VERFILE | cut -d. -f2 )
|
||||
PATCH=$( grep -oP "\d+\.\d+\.\d+" $VERFILE | cut -d. -f3 )
|
||||
|
||||
MAJ=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d. -f1 )
|
||||
MIN=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d. -f2 )
|
||||
PAT=$( grep -oP "\d+\.\d+\.\d+" /usr/local/etc/ncp-version | cut -d. -f3 )
|
||||
|
||||
if [[ $MAJOR > $MAJ ]]; then
|
||||
NEED_UPDATE=true
|
||||
elif [[ $MAJOR == $MAJ ]] && [[ $MINOR > $MIN ]]; then
|
||||
NEED_UPDATE=true
|
||||
elif [[ $MAJOR == $MAJ ]] && [[ $MINOR == $MIN ]] && [[ $PATCH > $PAT ]]; then
|
||||
NEED_UPDATE=true
|
||||
fi
|
||||
fi
|
||||
|
||||
if $NEED_UPDATE; then
|
||||
echo -e "\nNextCloudPi \e[1m$( cat $VERFILE )\e[0m available!!"
|
||||
echo -e "update through 'nextcloudpi-config' or type 'sudo ncp-update'"
|
||||
else
|
||||
echo -e "\nNextCloudPi \e[1m$( cat /usr/local/etc/ncp-version )\e[0m is up to date"
|
||||
fi
|
||||
EOF
|
||||
chmod a+x /usr/local/bin/ncp-check-updates
|
||||
|
||||
|
||||
cat > /etc/cron.daily/ncp-check-version <<EOF
|
||||
#!/bin/sh
|
||||
/usr/local/bin/ncp-check-version
|
||||
EOF
|
||||
chmod a+x /etc/cron.daily/ncp-check-version
|
||||
|
||||
|
||||
cat > /usr/local/bin/ncp-check-version <<'EOF'
|
||||
#!/bin/bash
|
||||
[ $(id -u) -ne 0 ] && exit 1
|
||||
git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-check-tmp
|
||||
cd /tmp/ncp-check-tmp
|
||||
git describe --always --tags > /var/run/.ncp-latest-version
|
||||
cd /
|
||||
rm -rf /tmp/ncp-check-tmp
|
||||
EOF
|
||||
chmod a+x /usr/local/bin/ncp-check-version
|
||||
|
||||
|
||||
cat > /usr/local/bin/ncp-update <<'EOF'
|
||||
#!/bin/bash
|
||||
echo -e "Downloading updates"
|
||||
rm -rf /tmp/ncp-update-tmp
|
||||
git clone -q --depth 1 https://github.com/nachoparker/nextcloud-raspbian-generator.git /tmp/ncp-update-tmp
|
||||
cd /tmp/ncp-update-tmp
|
||||
|
||||
echo -e "Performing updates"
|
||||
./update.sh
|
||||
|
||||
VER=$( git describe --always --tags )
|
||||
echo $VER > /usr/local/etc/ncp-version
|
||||
echo $VER > /var/run/.ncp-latest-version
|
||||
|
||||
cd /
|
||||
rm -rf /tmp/ncp-update-tmp
|
||||
|
||||
echo -e "NextCloudPi updated to version \e[1m$VER\e[0m"
|
||||
EOF
|
||||
chmod a+x /usr/local/bin/ncp-update
|
||||
|
||||
/usr/local/bin/ncp-update
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
46
update.sh
Executable file
46
update.sh
Executable file
@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Updaterfor NextCloudPi
|
||||
# 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!
|
||||
#
|
||||
# More at https://ownyourbits.com/
|
||||
#
|
||||
|
||||
|
||||
cp etc/library.sh /usr/local/etc/
|
||||
|
||||
source /usr/local/etc/library.sh
|
||||
|
||||
# copy all files in bin and etc
|
||||
for file in bin/* etc/*; do
|
||||
[ -f $file ] || continue;
|
||||
cp $file /usr/local/$file
|
||||
done
|
||||
|
||||
# install new entries of nextcloudpi-config and update others
|
||||
for file in etc/nextcloudpi-config.d/*; do
|
||||
[ -f $file ] || continue;
|
||||
[ -f /usr/local/$file ] || install_script $file
|
||||
cp $file /usr/local/$file
|
||||
done
|
||||
|
||||
# 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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user