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
879ab883
Commit
879ab883
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
functions to remove babel
parent
01e84bfc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/freedombone-app-babel
+44
-25
44 additions, 25 deletions
src/freedombone-app-babel
src/freedombone-mesh-install
+18
-1
18 additions, 1 deletion
src/freedombone-mesh-install
with
62 additions
and
26 deletions
src/freedombone-app-babel
+
44
−
25
View file @
879ab883
...
...
@@ -32,38 +32,57 @@
ENABLE_BABEL
=
"no"
BABEL_PORT
=
6696
function
remove_babel
{
if
!
grep
-Fxq
"mesh_babel"
$COMPLETION_FILE
;
then
return
fi
${
PROJECT_NAME
}
-mesh-install
-f
babel
--remove
yes
if
[
!
"
$?
"
=
"0"
]
;
then
echo
$'Failed to remove babel'
exit
83658
fi
iptables
-D
INPUT
-i
$WIFI_INTERFACE
-p
udp
--dport
$BABEL_PORT
-j
ACCEPT
function_check save_firewall_settings
save_firewall_settings
sed
-i
'/mesh_babel/d'
$COMPLETION_FILE
sed
-i
'/configure_firewall_for_babel/d'
$COMPLETION_FILE
}
function
configure_firewall_for_babel
{
if
grep
-Fxq
"configure_firewall_for_babel"
$COMPLETION_FILE
;
then
return
fi
if
[[
$ENABLE_BABEL
!=
"yes"
]]
;
then
return
fi
iptables
-A
INPUT
-i
$WIFI_INTERFACE
-p
udp
--dport
$BABEL_PORT
-j
ACCEPT
function_check save_firewall_settings
save_firewall_settings
if
grep
-Fxq
"configure_firewall_for_babel"
$COMPLETION_FILE
;
then
return
fi
if
[[
$ENABLE_BABEL
!=
"yes"
]]
;
then
return
fi
iptables
-A
INPUT
-i
$WIFI_INTERFACE
-p
udp
--dport
$BABEL_PORT
-j
ACCEPT
function_check save_firewall_settings
save_firewall_settings
OPEN_PORTS+
=(
"Babel
$BABEL_PORT
"
)
echo
'configure_firewall_for_babel'
>>
$COMPLETION_FILE
OPEN_PORTS+
=(
"Babel
$BABEL_PORT
"
)
echo
'configure_firewall_for_babel'
>>
$COMPLETION_FILE
}
function
mesh_babel
{
if
grep
-Fxq
"mesh_babel"
$COMPLETION_FILE
;
then
return
fi
if
[[
$ENABLE_BABEL
!=
"yes"
]]
;
then
return
fi
if
grep
-Fxq
"mesh_babel"
$COMPLETION_FILE
;
then
return
fi
if
[[
$ENABLE_BABEL
!=
"yes"
]]
;
then
return
fi
${
PROJECT_NAME
}
-mesh-install
-f
babel
if
[
!
"
$?
"
=
"0"
]
;
then
echo
$'Failed to install babel'
exit
67242
fi
${
PROJECT_NAME
}
-mesh-install
-f
babel
if
[
!
"
$?
"
=
"0"
]
;
then
echo
$'Failed to install babel'
exit
67242
fi
function_check configure_firewall_for_babel
configure_firewall_for_babel
echo
'mesh_babel'
>>
$COMPLETION_FILE
function_check configure_firewall_for_babel
configure_firewall_for_babel
echo
'mesh_babel'
>>
$COMPLETION_FILE
}
# NOTE: deliberately there is no "exit 0"
This diff is collapsed.
Click to expand it.
src/freedombone-mesh-install
+
18
−
1
View file @
879ab883
...
...
@@ -77,6 +77,8 @@ INSTALL_DIR=$HOME/build
MESH_INSTALL_DIR
=
/var/lib
REMOVE
=
'no'
source
/usr/local/bin/
${
PROJECT_NAME
}
-utils-git
if
[
-f
/usr/bin/
${
PROJECT_NAME
}
-utils-git
]
;
then
source
/usr/bin/
${
PROJECT_NAME
}
-utils-git
...
...
@@ -178,6 +180,13 @@ function mesh_babel {
$CHROOT_PREFIX
systemctl
enable
babel
}
function
mesh_babel_remove
{
$CHROOT_PREFIX
systemctl stop babel
$CHROOT_PREFIX
apt-get
-y
remove
--purge
babeld
rm
${
rootdir
}
/var/lib/babel
rm
${
rootdir
}
/etc/systemd/system/babel.service
}
function
mesh_avahi
{
$CHROOT_PREFIX
apt-get
-y
install
avahi-utils avahi-autoipd avahi-dnsconfd
...
...
@@ -1030,6 +1039,10 @@ do
shift
FRIENDS_MIRRORS_SERVER
=
"
$1
"
;;
--remove
)
shift
REMOVE
=
"
$1
"
;;
*
)
# unknown option
;;
...
...
@@ -1039,7 +1052,11 @@ do
done
if
[[
$FN
==
'babel'
]]
;
then
mesh_babel
if
[[
$REMOVE
!=
'yes'
]]
;
then
mesh_babel
else
mesh_babel_remove
fi
fi
if
[[
$FN
==
'babel_client'
]]
;
then
mesh_babel_client
...
...
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