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
9ffb0fe5
Commit
9ffb0fe5
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Move xmpp local restore to app script
parent
781453c7
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-app-ipfs
+28
-0
28 additions, 0 deletions
src/freedombone-app-ipfs
src/freedombone-app-xmpp
+25
-0
25 additions, 0 deletions
src/freedombone-app-xmpp
src/freedombone-restore-local
+0
-44
0 additions, 44 deletions
src/freedombone-restore-local
with
53 additions
and
44 deletions
src/freedombone-app-ipfs
+
28
−
0
View file @
9ffb0fe5
...
...
@@ -63,10 +63,38 @@ function backup_local_ipfs {
fi
}
function
restore_local_ipfs
{
if
!
grep
-q
"Admin user"
$COMPLETION_FILE
;
then
return
fi
if
[
-d
$USB_MOUNT
/backup/ipfs
]
;
then
echo
$"Restoring IPFS"
temp_restore_dir
=
/root/tempipfs
function_check restore_directory_from_usb
restore_directory_from_usb
$temp_restore_dir
ipfs
ADMIN_USERNAME
=
$(
cat
$COMPLETION_FILE
|
grep
"Admin user"
|
awk
-F
':'
'{print $2}'
)
cp
-rf
$temp_restore_dir
/home/
$ADMIN_USERNAME
/.ipfs/
*
/home/
$ADMIN_USERNAME
/.ipfs
if
[
!
"
$?
"
=
"0"
]
;
then
rm
-rf
$temp_restore_dir
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit
27627
fi
rm
-rf
$temp_restore_dir
echo
$"Restore of IPFS complete"
fi
}
function
backup_remote_ipfs
{
echo
-n
''
}
function
restore_remote_ipfs
{
echo
-n
''
}
function
remove_ipfs
{
if
!
grep
-Fxq
"install_ipfs"
$COMPLETION_FILE
;
then
return
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-app-xmpp
+
25
−
0
View file @
9ffb0fe5
...
...
@@ -116,10 +116,35 @@ function backup_local_xmpp {
fi
}
function
restore_local_xmpp
{
if
[
-d
/var/lib/prosody
]
;
then
echo
$"Restoring XMPP settings"
temp_restore_dir
=
/root/tempxmpp
function_check restore_directory_from_usb
restore_directory_from_usb
$temp_restore_dir
xmpp
cp
-r
$temp_restore_dir
/var/lib/prosody/
*
/var/lib/prosody
if
[
!
"
$?
"
=
"0"
]
;
then
function_check set_user_permissions
set_user_permissions
function_check backup_unmount_drive
backup_unmount_drive
exit
725
fi
rm
-rf
$temp_restore_dir
service prosody restart
chown
-R
prosody:prosody /var/lib/prosody/
*
echo
$"Restore of XMPP settings complete"
fi
}
function
backup_remote_xmpp
{
echo
-n
''
}
function
restore_remote_xmpp
{
echo
-n
''
}
function
configure_firewall_for_xmpp
{
if
[
!
-d
/etc/prosody
]
;
then
return
...
...
This diff is collapsed.
Click to expand it.
src/freedombone-restore-local
+
0
−
44
View file @
9ffb0fe5
...
...
@@ -491,26 +491,6 @@ function restore_admin_readme {
fi
}
function
restore_ipfs
{
if
[[
$RESTORE_APP
!=
'all'
]]
;
then
if
[[
$RESTORE_APP
!=
'ipfs'
]]
;
then
return
fi
fi
if
[
-d
$USB_MOUNT
/backup/ipfs
]
;
then
echo
$"Restoring IPFS"
restore_directory_from_usb /root/tempipfs ipfs
cp
-rf
/root/tempipfs/home/
$ADMIN_USERNAME
/.ipfs/
*
/home/
$ADMIN_USERNAME
/.ipfs
if
[
!
"
$?
"
=
"0"
]
;
then
rm
-rf
/root/tempipfs
set_user_permissions
backup_unmount_drive
exit
276
fi
rm
-rf
/root/tempipfs
fi
}
function
restore_user_ssh_keys
{
if
[[
$RESTORE_APP
!=
'all'
]]
;
then
if
[[
$RESTORE_APP
!=
'ssh'
]]
;
then
...
...
@@ -797,27 +777,6 @@ function restore_mailing_list {
fi
}
function
restore_xmpp
{
if
[[
$RESTORE_APP
!=
'all'
]]
;
then
if
[[
$RESTORE_APP
!=
'xmpp'
]]
;
then
return
fi
fi
if
[
-d
/var/lib/prosody
]
;
then
echo
$"Restoring XMPP settings"
restore_directory_from_usb /root/tempxmpp xmpp
cp
-r
/root/tempxmpp/var/lib/prosody/
*
/var/lib/prosody
if
[
!
"
$?
"
=
"0"
]
;
then
set_user_permissions
backup_unmount_drive
exit
725
fi
rm
-rf
/root/tempxmpp
service prosody restart
chown
-R
prosody:prosody /var/lib/prosody/
*
fi
}
function
restore_email
{
if
[[
$RESTORE_APP
!=
'all'
]]
;
then
if
[[
$RESTORE_APP
!=
'email'
]]
;
then
...
...
@@ -905,9 +864,6 @@ restore_certs
restore_personal_settings
restore_mailing_list
restore_ipfs
restore_xmpp
restore_email
restore_apps
set_user_permissions
...
...
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