mirror of
https://github.com/deajan/obackup.git
synced 2024-12-04 20:53:41 +01:00
Uploaded ssh command filter
This commit is contained in:
parent
05ea27ac1b
commit
c05388f3d7
40
obackup_ssh_filter.sh
Executable file
40
obackup_ssh_filter.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user