summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5d1287b)
- Ignore SC1091: Not following: /etc/grml/script-functions was not specified as input (see shellcheck -x).
- Ignore SC1091: Not following: /etc/grml/lsb-functions was not specified as input (see shellcheck -x).
- SC2046: Quote this to prevent word splitting.
- SC2006: Use $(..) instead of legacy `..`.
- Ignore SC1090: Can't follow non-constant source. Use a directive to specify location.
- SC2046: Quote this to prevent word splitting.
- SC2006: Use $(..) instead of legacy `..`.
- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
- SC2046: Quote this to prevent word splitting.
- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
- SC2086: Double quote to prevent globbing and word splitting.
- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
+# shellcheck disable=SC1091
. /etc/grml/script-functions
. /etc/grml/script-functions
+# shellcheck disable=SC1091
. /etc/grml/lsb-functions
check4root
. /etc/grml/lsb-functions
check4root
# TODO / integrate?
cronsetup() {
# TODO / integrate?
cronsetup() {
- test -f ~/.keychain/`uname -n`-sh && . ~/.keychain/`uname -n`-sh
+# shellcheck disable=SC1090
+ test -f "${HOME}/.keychain/$(uname -n)-sh" && . "${HOME}/.keychain/$(uname -n)-sh"
if ! [ -d "$BACKUP_DIR" ] ; then
dialog --stdout --title "${PN}" --yesno "The directory $BACKUP_DIR does not yet exist. Do you want me to create it for you? " 0 0
if ! [ -d "$BACKUP_DIR" ] ; then
dialog --stdout --title "${PN}" --yesno "The directory $BACKUP_DIR does not yet exist. Do you want me to create it for you? " 0 0
+ if [ ${RC} -eq 0 ]; then
echo "mkdir $BACKUP_DIR"
echo "chmod 700 $BACKUP_DIR"
else
echo "mkdir $BACKUP_DIR"
echo "chmod 700 $BACKUP_DIR"
else
- CLIENTNAME="$(dialog --stdout --inputbox 'Please choose user login and hostname for the client you want to backup. Syntax: user@host' 0 0 root@$(hostname))"
+ CLIENTNAME="$(dialog --stdout --inputbox 'Please choose user login and hostname for the client you want to backup. Syntax: user@host' 0 0 root@"$(hostname)")"
dialog --stdout --title "${PN}" --yesno "Do you want me to create ssh setup for client ${CLIENTNAME} using ssh-keygen and ssh-copy-id?" 0 0
dialog --stdout --title "${PN}" --yesno "Do you want me to create ssh setup for client ${CLIENTNAME} using ssh-keygen and ssh-copy-id?" 0 0
+ if [ ${RC} -eq 0 ]; then
[ -d "$HOME/.ssh" ] || mkdir "$HOME/.ssh"
einfo "Creating $HOME/.ssh/id_rsa_dirvish_${CLIENT} using ssh-keygen:"
ssh-keygen -t rsa -f "$HOME/.ssh/id_rsa_dirvish_${CLIENT}" ; eend $?
einfo "Running ssh-copy-id to copy ssh key to $CLIENTNAME:"
[ -d "$HOME/.ssh" ] || mkdir "$HOME/.ssh"
einfo "Creating $HOME/.ssh/id_rsa_dirvish_${CLIENT} using ssh-keygen:"
ssh-keygen -t rsa -f "$HOME/.ssh/id_rsa_dirvish_${CLIENT}" ; eend $?
einfo "Running ssh-copy-id to copy ssh key to $CLIENTNAME:"
- ssh-copy-id -i "$HOME/.ssh/id_rsa_dirvish_${CLIENT}.pub" $CLIENTNAME ; eend $?
+ ssh-copy-id -i "$HOME/.ssh/id_rsa_dirvish_${CLIENT}.pub" "$CLIENTNAME" ; eend $?
fi
}
client_setup() {
dialog --stdout --title "${PN}" --yesno "Do you want to backup $CLIENT via network? Answering with no will use localhost [$(hostname)] as client." 0 0
fi
}
client_setup() {
dialog --stdout --title "${PN}" --yesno "Do you want to backup $CLIENT via network? Answering with no will use localhost [$(hostname)] as client." 0 0
+ if [ ${RC} -eq 0 ]; then
sshkey_setup
else
CLIENTNAME=$(hostname) # use localhost only
sshkey_setup
else
CLIENTNAME=$(hostname) # use localhost only
einfo "Running $PN was successful. Enjoy using dirvish!" ; eend 0
echo
einfo "Please adjust ${BACKUP_DIR}/${CLIENT}/dirvish/default.conf according to your needs.
einfo "Running $PN was successful. Enjoy using dirvish!" ; eend 0
echo
einfo "Please adjust ${BACKUP_DIR}/${CLIENT}/dirvish/default.conf according to your needs.
Then run the following command to create an initial backup:
dirvish --summary long --vault $CLIENT --init
Then run the following command to create an initial backup:
dirvish --summary long --vault $CLIENT --init