summaryrefslogtreecommitdiffstats
path: root/server/export_target
diff options
context:
space:
mode:
authorSebastian2014-01-30 10:40:11 +0100
committerSebastian2014-01-30 10:40:11 +0100
commit2e61e503974571153cd81e662abda5892b8b39e0 (patch)
tree0d94add73fa62d14ccc1bd52d3e395a349f27997 /server/export_target
parentadd module for swiss keymaps/locals (diff)
downloadtm-scripts-2e61e503974571153cd81e662abda5892b8b39e0.tar.gz
tm-scripts-2e61e503974571153cd81e662abda5892b8b39e0.tar.xz
tm-scripts-2e61e503974571153cd81e662abda5892b8b39e0.zip
allow to change default export path; on remote via mltk -n name; on server via
export REMOTE_EXPORT_DIR=/export/name
Diffstat (limited to 'server/export_target')
-rwxr-xr-xserver/export_target9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/export_target b/server/export_target
index 6edcecdc..22b8b062 100755
--- a/server/export_target
+++ b/server/export_target
@@ -25,6 +25,9 @@ SERVER_BUILD_DIR="${MODE_DIR}/local_builds/${REMOTE_IP}"
# target directory
SERVER_CONFIGS_DIR="${MODE_DIR}/configs"
+# allow to specify a different remote export dir via ENV
+[ -z $REMOTE_EXPORT_DIR ] && REMOTE_EXPORT_DIR="/export/build"
+
# initial checks
initial_checks() {
@@ -46,16 +49,16 @@ copy_kernel() {
sync_remote() {
[[ "${#SERVER_BUILD_DIR}" -lt "10" ]] && perror "Safety check failed: SERVER_BUILD_DIR is less than 10 chars. ($SERVER_BUILD_DIR)"
- pinfo "Synching 'root@$REMOTE_IP:export/build' to '$SERVER_BUILD_DIR'. This might take a while..."
+ pinfo "Synching 'root@$REMOTE_IP:$REMOTE_EXPORT_DIR' to '$SERVER_BUILD_DIR'. This might take a while..."
#TODO setup link to remote build directory, later this directory will be rsynced or exported to this server...
mkdir -p "${SERVER_BUILD_DIR}" || perror "Could not create directory for local copy of remote system ($SERVER_BUILD_DIR)"
- rsync -a --numeric-ids --exclude '**/.mltk' --delete --delete-excluded -v -e "ssh -c arcfour -oStrictHostKeyChecking=no" "root@$REMOTE_IP:/export/build/*" "$SERVER_BUILD_DIR"
+ rsync -a --numeric-ids --exclude '**/.mltk' --delete --delete-excluded -v -e "ssh -c arcfour -oStrictHostKeyChecking=no" "root@$REMOTE_IP:$REMOTE_EXPORT_DIR/*" "$SERVER_BUILD_DIR"
local RET=$?
if [ $RET -eq 0 ]; then
pinfo "Syncing completed."
else
- perror "Syncing of 'root@$REMOTE_IP:/export/build' to '$SERVER_BUILD_DIR' failed with error code: $RET. (Is '/export/build' available on target machine? If not run './mltk -n' on remote machine to export the build directory.)"
+ perror "Syncing of 'root@$REMOTE_IP:$REMOTE_EXPORT_DIR' to '$SERVER_BUILD_DIR' failed with error code: $RET. (Is '$REMOTE_EXPORT_DIR' available on target machine? If not run './mltk -n' on remote machine to export the build directory.)"
fi
}