Introduce backup plugin to export/import settings
This commit is contained in:
8
plugins/00_dokku-standard/backup-export
Executable file
8
plugins/00_dokku-standard/backup-export
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
VERSION="$1"
|
||||
BASE_DIR="$2"
|
||||
|
||||
cat;
|
||||
[[ -f $BASE_DIR/.ssh/authorized_keys ]] && echo "$BASE_DIR/.ssh/authorized_keys"
|
||||
[[ -f $BASE_DIR/HOSTNAME ]] && echo "$BASE_DIR/HOSTNAME"
|
||||
[[ -f $BASE_DIR/VHOST ]] && echo "$BASE_DIR/VHOST"
|
||||
13
plugins/00_dokku-standard/backup-import
Executable file
13
plugins/00_dokku-standard/backup-import
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
VERSION="$1"
|
||||
IMPORT_DIR="$2"
|
||||
TARGET_DIR="$3"
|
||||
|
||||
if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then
|
||||
mkdir $TARGET_DIR/.ssh
|
||||
mv $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys
|
||||
chmod 0700 $TARGET_DIR/.ssh
|
||||
chmod 0600 $TARGET_DIR/.ssh/*
|
||||
fi
|
||||
[[ -f $IMPORT_DIR/HOSTNAME ]] && mv $IMPORT_DIR/HOSTNAME $TARGET_DIR/HOSTNAME
|
||||
[[ -f $IMPORT_DIR/VHOST ]] && mv $IMPORT_DIR/VHOST $TARGET_DIR/VHOST
|
||||
Reference in New Issue
Block a user