1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-14 03:33:41 +01:00
obackup/obackup_ssh_filter.sh
2013-06-23 13:44:48 +02:00

41 lines
610 B
Bash
Executable File

#!/bin/bash
##### Obackup ssh command filter
## Paranoia option. Only change this if you read the documentation and know what you're doing
RSYNC_EXECUTABLE=rsync
function Go
{
$SSH_ORIGINAL_COMMAND
}
case ${SSH_ORIGINAL_COMMAND%% *} in
"$RSYNC_EXECUTABLE")
Go ;;
"mysqldump")
Go ;;
"find")
Go ;;
"du")
Go ;;
"sudo")
if [[ "$SSH_ORIGINAL_COMMAND" == "sudo $RSYNC_EXECUTABLE"* ]]
then
Go
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo du"* ]]
then
Go
elif [[ "$SSH_ORIGINAL_COMMAND" == "sudo find"* ]]
then
Go
else
echo "Sudo command not allowed."
fi
;;
*)
echo "Not allowed."
esac