123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #! /bin/bash
- laptop_host="moving-computer-of-doom"
- remote_host="tiny-server-of-doom"
- if [ $HOSTNAME = $laptop_host ]; then
- case "$SSH_ORIGINAL_COMMAND" in
- *\&*|*\|*|*\;*|*\>*|*\<*|*\!*)
- exit 1
- ;;
- ## This needs to be set in /etc/rsnapshot.conf rsync_long_args
- /usr/bin/rsync\ --server\ --sender*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- *)
- exit 1
- ;;
- esac
- elif [ $HOSTNAME = $remote_host ]; then
- case "$SSH_ORIGINAL_COMMAND" in
- *\&*|*\|*|*\;*|*\>*|*\<*|*\!*)
- exit 1
- ;;
- mount*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- umount*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- cryptsetup\ luksOpen*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- cryptsetup\ luksClose*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- rmdir*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- mkdir*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- rsnapshot*)
- sudo $SSH_ORIGINAL_COMMAND
- ;;
- *)
- exit 1
- ;;
- esac
- fi
|