Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
03ff8993
Commit
03ff8993
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Preparing app setup
parent
9ce622b5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/freedombone-selector
+7
-76
7 additions, 76 deletions
src/freedombone-selector
src/freedombone-utils-selector
+113
-0
113 additions, 0 deletions
src/freedombone-utils-selector
src/freedombone-utils-setup
+7
-18
7 additions, 18 deletions
src/freedombone-utils-setup
with
127 additions
and
94 deletions
src/freedombone-selector
+
7
−
76
View file @
03ff8993
...
@@ -42,56 +42,7 @@ source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars
...
@@ -42,56 +42,7 @@ source $PROJECT_INSTALL_DIR/${PROJECT_NAME}-vars
COMPLETION_FILE
=
$HOME
/
${
PROJECT_NAME
}
-completed
.txt
COMPLETION_FILE
=
$HOME
/
${
PROJECT_NAME
}
-completed
.txt
# Array containing names of available apps
source
$PROJECT_INSTALL_DIR
/
${
PROJECT_NAME
}
-utils-selector
APPS_AVAILABLE
=()
# Array containing 1 or 0 indicating installed apps
APPS_INSTALLED
=()
# Apps selected with checklist
APPS_CHOSEN
=()
function
item_in_array
{
local
e
for
e
in
"
${
@
:2
}
"
;
do
[[
"
$e
"
==
"
$1
"
]]
&&
return
0
;
done
return
1
}
function
app_is_installed
{
app_name
=
"
$1
"
if
[
!
-f
$COMPLETION_FILE
]
;
then
echo
"0"
return
fi
if
!
grep
-Fxq
"install_
${
app_name
}
"
$COMPLETION_FILE
;
then
echo
"0"
else
echo
"1"
fi
}
function
get_apps_installed
{
for
a
in
"
${
APPS_AVAILABLE
[@]
}
"
do
APPS_INSTALLED+
=(
"
$(
app_is_installed
$a
)
"
)
done
}
function
detect_apps
{
FILES
=
$PROJECT_INSTALL_DIR
/
${
PROJECT_NAME
}
-app-
*
# for all the app scripts
for
filename
in
$FILES
do
app_name
=
$(
echo
"
${
filename
}
"
|
awk
-F
'-app-'
'{print $2}'
)
if
[[
$(
item_in_array
${
app_name
}
${
APPS_AVAILABLE
[@]
}
)
!=
0
]]
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_CHOSEN+
=(
"0"
)
fi
done
get_apps_installed
}
function
show_apps
{
function
show_apps
{
applist
=
""
applist
=
""
...
@@ -124,7 +75,7 @@ function show_apps {
...
@@ -124,7 +75,7 @@ function show_apps {
fi
fi
}
}
function
remove_apps
{
function
remove_apps
_interactive
{
# which apps need to be removed?
# which apps need to be removed?
removals
=
""
removals
=
""
app_index
=
0
app_index
=
0
...
@@ -162,20 +113,10 @@ function remove_apps {
...
@@ -162,20 +113,10 @@ function remove_apps {
# remove the apps
# remove the apps
read_configuration
read_configuration
for
a
in
"
${
APPS_AVAILABLE
[@]
}
"
remove_apps
do
if
[[
${
APPS_INSTALLED
[
$app_index
]
}
==
"1"
]]
;
then
if
[[
${
APPS_CHOSEN
[
$app_index
]
}
==
"0"
]]
;
then
echo
$"Removing application:
${
a
}
"
remove_
${
a
}
echo
$"
${
a
}
was removed"
fi
fi
app_index
=
$[
app_index+1]
done
}
}
function
install_apps
{
function
install_apps
_interactive
{
# which apps need to be installed?
# which apps need to be installed?
installs
=
""
installs
=
""
app_index
=
0
app_index
=
0
...
@@ -213,17 +154,7 @@ function install_apps {
...
@@ -213,17 +154,7 @@ function install_apps {
# install the apps
# install the apps
read_configuration
read_configuration
for
a
in
"
${
APPS_AVAILABLE
[@]
}
"
install_apps
do
if
[[
${
APPS_INSTALLED
[
$app_index
]
}
==
"0"
]]
;
then
if
[[
${
APPS_CHOSEN
[
$app_index
]
}
==
"1"
]]
;
then
echo
$"Installing application:
${
a
}
"
install_
${
a
}
echo
$"
${
a
}
was installed"
fi
fi
app_index
=
$[
app_index+1]
done
}
}
${
PROJECT_NAME
}
-tests
${
PROJECT_NAME
}
-tests
...
@@ -242,7 +173,7 @@ show_apps
...
@@ -242,7 +173,7 @@ show_apps
clear
clear
remove_apps
remove_apps
_interactive
install_apps
install_apps
_interactive
exit
0
exit
0
This diff is collapsed.
Click to expand it.
src/freedombone-utils-selector
0 → 100644
+
113
−
0
View file @
03ff8993
#!/bin/bash
#
# .---. . .
# | | |
# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
#
# Freedom in the Cloud
#
# Functions for selecting which apps to install or remove
#
# License
# =======
#
# Copyright (C) 2015-2016 Bob Mottram <bob@robotics.uk.to>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Array containing names of available apps
APPS_AVAILABLE
=()
# Array containing 1 or 0 indicating installed apps
APPS_INSTALLED
=()
# Apps selected with checklist
APPS_CHOSEN
=()
function
item_in_array
{
local
e
for
e
in
"
${
@
:2
}
"
;
do
[[
"
$e
"
==
"
$1
"
]]
&&
return
0
;
done
return
1
}
function
app_is_installed
{
app_name
=
"
$1
"
if
[
!
-f
$COMPLETION_FILE
]
;
then
echo
"0"
return
fi
if
!
grep
-Fxq
"install_
${
app_name
}
"
$COMPLETION_FILE
;
then
echo
"0"
else
echo
"1"
fi
}
function
get_apps_installed
{
for
a
in
"
${
APPS_AVAILABLE
[@]
}
"
do
APPS_INSTALLED+
=(
"
$(
app_is_installed
$a
)
"
)
done
}
function
detect_apps
{
FILES
=
$PROJECT_INSTALL_DIR
/
${
PROJECT_NAME
}
-app-
*
APPS_AVAILABLE
=()
APPS_CHOSEN
=()
# for all the app scripts
for
filename
in
$FILES
do
app_name
=
$(
echo
"
${
filename
}
"
|
awk
-F
'-app-'
'{print $2}'
)
if
[[
$(
item_in_array
${
app_name
}
${
APPS_AVAILABLE
[@]
}
)
!=
0
]]
;
then
APPS_AVAILABLE+
=(
"
${
app_name
}
"
)
APPS_CHOSEN+
=(
"0"
)
fi
done
get_apps_installed
}
function
remove_apps
{
app_index
=
0
for
a
in
"
${
APPS_AVAILABLE
[@]
}
"
do
if
[[
${
APPS_INSTALLED
[
$app_index
]
}
==
"1"
]]
;
then
if
[[
${
APPS_CHOSEN
[
$app_index
]
}
==
"0"
]]
;
then
echo
$"Removing application:
${
a
}
"
remove_
${
a
}
echo
$"
${
a
}
was removed"
fi
fi
app_index
=
$[
app_index+1]
done
}
function
install_apps
{
app_index
=
0
for
a
in
"
${
APPS_AVAILABLE
[@]
}
"
do
if
[[
${
APPS_INSTALLED
[
$app_index
]
}
==
"0"
]]
;
then
if
[[
${
APPS_CHOSEN
[
$app_index
]
}
==
"1"
]]
;
then
echo
$"Installing application:
${
a
}
"
install_
${
a
}
echo
$"
${
a
}
was installed"
fi
fi
app_index
=
$[
app_index+1]
done
}
This diff is collapsed.
Click to expand it.
src/freedombone-utils-setup
+
7
−
18
View file @
03ff8993
...
@@ -326,24 +326,13 @@ function setup_web {
...
@@ -326,24 +326,13 @@ function setup_web {
}
}
function
setup_apps
{
function
setup_apps
{
install_zeronet
function_check detect_apps
install_syncthing
detect_apps
install_gogs
install_xmpp
# TODO choose apps based upon variants
install_tox
install_irc
function_check install_apps
install_mumble
install_apps
install_sip
install_wiki
install_blog
install_gnusocial
install_rss
install_hubzilla
#install_webmail
#install_search_engine
install_dlna
#install_mediagoblin
#install_ipfs
}
}
# NOTE: deliberately no exit 0
# NOTE: deliberately no exit 0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment