mirror of
https://github.com/BastilleBSD/bastille.git
synced 2025-12-11 17:39:52 +01:00
Update migrate.sh
This commit is contained in:
@@ -122,7 +122,7 @@ migrate_cleanup() {
|
|||||||
local _host="${3}"
|
local _host="${3}"
|
||||||
|
|
||||||
# Remove archive files from local and remote system
|
# Remove archive files from local and remote system
|
||||||
ssh ${_user}@${_host} sudo rm -f ${_remote_bastille_migratedir}/${_jail}_*.*
|
ssh ${_user}@${_host} sudo rm -f "${_remote_bastille_migratedir}/${_jail}_*.*"
|
||||||
rm -f ${bastille_migratedir}/${_jail}_*.*
|
rm -f ${bastille_migratedir}/${_jail}_*.*
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ migrate_jail() {
|
|||||||
info "\nAttempting to migrate jail to remote system..."
|
info "\nAttempting to migrate jail to remote system..."
|
||||||
|
|
||||||
local _file="$(find "${bastille_migratedir}" -maxdepth 1 -type f | grep -Eo "${_jail}_.*\.xz$" | head -n1)"
|
local _file="$(find "${bastille_migratedir}" -maxdepth 1 -type f | grep -Eo "${_jail}_.*\.xz$" | head -n1)"
|
||||||
local _file_sha256="$(echo ${_file} | sed 's/\.*/.sha256/')"
|
local _file_sha256="$(echo ${_file} | sed 's/\..*/.sha256/')"
|
||||||
|
|
||||||
# Send sha256
|
# Send sha256
|
||||||
if ! scp ${bastille_migratedir}/${_file_sha256} ${_user}@${_host}:${_remote_bastille_migratedir}; then
|
if ! scp ${bastille_migratedir}/${_file_sha256} ${_user}@${_host}:${_remote_bastille_migratedir}; then
|
||||||
@@ -198,7 +198,7 @@ migrate_jail() {
|
|||||||
info "\nAttempting to migrate jail to remote system..."
|
info "\nAttempting to migrate jail to remote system..."
|
||||||
|
|
||||||
local _file="$(find "${bastille_migratedir}" -maxdepth 1 -type f | grep -Eo "${_jail}_.*\.txz$" | head -n1)"
|
local _file="$(find "${bastille_migratedir}" -maxdepth 1 -type f | grep -Eo "${_jail}_.*\.txz$" | head -n1)"
|
||||||
local _file_sha256="$(echo ${_file} | sed 's/\.*/.sha256/')"
|
local _file_sha256="$(echo ${_file} | sed 's/\..*/.sha256/')"
|
||||||
|
|
||||||
# Send sha256
|
# Send sha256
|
||||||
if ! scp ${bastille_migratedir}/${_file_sha256} ${_user}@${_host}:${_remote_bastille_migratedir}; then
|
if ! scp ${bastille_migratedir}/${_file_sha256} ${_user}@${_host}:${_remote_bastille_migratedir}; then
|
||||||
|
|||||||
Reference in New Issue
Block a user