Truly appreciate this script. I never had problems with ransomware but heard enough stories to fear them.
Mistakes were made when I setted up my shares and I used spaces in some of them, when I try to run the scripts this is the output:
root@Fone:~# /mnt/user/appdata/no_ransom/no_ransom.sh --lock-files 'yes' --media-shares 'short films' --debug 'yes'
[info] Running no_ransom.sh script...
[info] Checking we have all required parameters before running...
[info] Finding share that match 'short films' on disk '/mnt/disk1'...
[debug] find /mnt/disk1 -maxdepth 1 -type d -name short films
[info] Share found, processing media share '/mnt/disk1/short films' using 'chattr' recursively...
[debug] find /mnt/disk1/short films -type f \( -name "*.*" \) -exec chattr +i {} \;
find: ‘/mnt/disk1/short’: No such file or directory
find: ‘films’: No such file or directory
[info] Processing finished for disk '/mnt/disk1'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk2'...
[debug] find /mnt/disk2 -maxdepth 1 -type d -name short films
[debug] No matching media share for disk '/mnt/disk2'
[info] Processing finished for disk '/mnt/disk2'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk3'...
[debug] find /mnt/disk3 -maxdepth 1 -type d -name short films
[info] Share found, processing media share '/mnt/disk3/short films' using 'chattr' recursively...
[debug] find /mnt/disk3/short films -type f \( -name "*.*" \) -exec chattr +i {} \;
find: ‘/mnt/disk3/short’: No such file or directory
find: ‘films’: No such file or directory
[info] Processing finished for disk '/mnt/disk3'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk4'...
[debug] find /mnt/disk4 -maxdepth 1 -type d -name short films
[info] Share found, processing media share '/mnt/disk4/short films' using 'chattr' recursively...
[debug] find /mnt/disk4/short films -type f \( -name "*.*" \) -exec chattr +i {} \;
find: ‘/mnt/disk4/short’: No such file or directory
find: ‘films’: No such file or directory
[info] Processing finished for disk '/mnt/disk4'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk5'...
[debug] find /mnt/disk5 -maxdepth 1 -type d -name short films
[debug] No matching media share for disk '/mnt/disk5'
[info] Processing finished for disk '/mnt/disk5'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk6'...
[debug] find /mnt/disk6 -maxdepth 1 -type d -name short films
[info] Share found, processing media share '/mnt/disk6/short films' using 'chattr' recursively...
[debug] find /mnt/disk6/short films -type f \( -name "*.*" \) -exec chattr +i {} \;
find: ‘/mnt/disk6/short’: No such file or directory
find: ‘films’: No such file or directory
[info] Processing finished for disk '/mnt/disk6'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk7'...
[debug] find /mnt/disk7 -maxdepth 1 -type d -name short films
[info] Share found, processing media share '/mnt/disk7/short films' using 'chattr' recursively...
[debug] find /mnt/disk7/short films -type f \( -name "*.*" \) -exec chattr +i {} \;
find: ‘/mnt/disk7/short’: No such file or directory
find: ‘films’: No such file or directory
[info] Processing finished for disk '/mnt/disk7'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disk8'...
[debug] find /mnt/disk8 -maxdepth 1 -type d -name short films
[info] Share found, processing media share '/mnt/disk8/short films' using 'chattr' recursively...
[debug] find /mnt/disk8/short films -type f \( -name "*.*" \) -exec chattr +i {} \;
find: ‘/mnt/disk8/short’: No such file or directory
find: ‘films’: No such file or directory
[info] Processing finished for disk '/mnt/disk8'
[info]
[info] Finding share that match 'short films' on disk '/mnt/disks'...
[debug] find /mnt/disks -maxdepth 1 -type d -name short films
[debug] No matching media share for disk '/mnt/disks'
[info] Processing finished for disk '/mnt/disks'
[info]
[info] no_ransom.sh script finished
After running it I have verified running "lsattr /mnt/user/short\ films/" that the files are still unprotected. Can I run the script somehow without changing my share names?